fix: 会错误地尝试对网络链接进行短链接压缩(Meloong-Git/PCL#9314)
This commit is contained in:
1 parent
6b292a45f7
commit
9d877cc32c
1 file changed
+4
-2
@@ -24,9 +24,11 @@ public static class PathUtils {
|
|||||||
/// <para/>结果的开头不含 <c>\\?\</c>,结尾不含分隔符。
|
/// <para/>结果的开头不含 <c>\\?\</c>,结尾不含分隔符。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string ToShortPath(string pathName) {
|
public static string ToShortPath(string pathName) {
|
||||||
|
// 快速返回
|
||||||
if (string.IsNullOrEmpty(pathName)) return pathName;
|
if (string.IsNullOrEmpty(pathName)) return pathName;
|
||||||
if (!pathName.Contains(":")) return pathName;
|
if (!pathName.Contains(":") || pathName.Contains("://")) return pathName;
|
||||||
if (pathName.Length <= 220) return pathName; // 快速返回
|
if (pathName.Length <= 220) return pathName;
|
||||||
|
// 开始实际处理
|
||||||
pathName = PathUtils.ForCompare(pathName);
|
pathName = PathUtils.ForCompare(pathName);
|
||||||
// 尽量保留原始文件名
|
// 尽量保留原始文件名
|
||||||
string pathToKeep = "";
|
string pathToKeep = "";
|
||||||
|
|||||||
Reference in new issue
Block a user