From 0b563f393b631e97a014c2d3e96f4f2f8cfd0be5 Mon Sep 17 00:00:00 2001 From: ninemine <1371605831@qq.com> Date: Tue, 25 Nov 2025 17:03:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DFile=E4=B8=AD=E5=90=88?= =?UTF-8?q?=E6=88=90=E8=B7=AF=E5=BE=84=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Convention/[Runtime]/File.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Convention/[Runtime]/File.cs b/Convention/[Runtime]/File.cs index 8c7a76c..6cb79c8 100644 --- a/Convention/[Runtime]/File.cs +++ b/Convention/[Runtime]/File.cs @@ -460,7 +460,7 @@ namespace Convention #region Operator - public static ToolFile operator |(ToolFile left, string rightPath) + public static ToolFile operator |(ToolFile left, [Opt] string rightPath) { if (rightPath == null) { @@ -472,12 +472,7 @@ namespace Convention return new ToolFile(second); else if (first == "../") return new ToolFile($"{new ToolFile(left.GetAbsPath()).GetParentDir()}/{second}"); - return new ToolFile($"{first}/{second}"); - } - public static ToolFile operator |(ToolFile left, ToolFile rightPath) - { - string lp = left.GetFullPath(); - return new ToolFile(Path.Combine(lp, rightPath)); + return new ToolFile($"{first}{(first.EndsWith('/') ? "" : "/")}{second}"); } public override bool Equals(object obj)