From c0cdb2ad99a1e2a6ade5ce76c91177a79258e669 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:10:11 +0200 Subject: 3.14 --- shared/long_path_prefix.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'shared/long_path_prefix.cpp') diff --git a/shared/long_path_prefix.cpp b/shared/long_path_prefix.cpp index 3fb0703d..dc249283 100644 --- a/shared/long_path_prefix.cpp +++ b/shared/long_path_prefix.cpp @@ -16,8 +16,8 @@ template inline Zstring applyLongPathPrefixImpl(const Zstring& path) { - if ( path.length() >= max_path && //maximum allowed path length without prefix is (MAX_PATH - 1) - !path.StartsWith(LONG_PATH_PREFIX)) + if (path.length() >= max_path && //maximum allowed path length without prefix is (MAX_PATH - 1) + !path.StartsWith(LONG_PATH_PREFIX)) { if (path.StartsWith(Zstr("\\\\"))) //UNC-name, e.g. \\zenju-pc\Users return LONG_PATH_PREFIX_UNC + path.AfterFirst(Zchar('\\')); //convert to \\?\UNC\zenju-pc\Users @@ -47,12 +47,10 @@ Zstring ffs3::removeLongPathPrefix(const Zstring& path) //throw() { if (path.StartsWith(LONG_PATH_PREFIX)) { - Zstring finalPath = path; if (path.StartsWith(LONG_PATH_PREFIX_UNC)) //UNC-name - finalPath.Replace(LONG_PATH_PREFIX_UNC, Zstr("\\"), false); + return Zstring(path).Replace(LONG_PATH_PREFIX_UNC, Zstr("\\"), false); else - finalPath.Replace(LONG_PATH_PREFIX, Zstr(""), false); - return finalPath; + return Zstring(path).Replace(LONG_PATH_PREFIX, Zstr(""), false); } //fallback -- cgit