diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:10:11 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:10:11 +0200 |
commit | c0cdb2ad99a1e2a6ade5ce76c91177a79258e669 (patch) | |
tree | 4701a015385d9a6a5a4ba99a8f1f5d400fff26b1 /shared/long_path_prefix.cpp | |
parent | 3.13 (diff) | |
download | FreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.tar.gz FreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.tar.bz2 FreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.zip |
3.14
Diffstat (limited to 'shared/long_path_prefix.cpp')
-rw-r--r-- | shared/long_path_prefix.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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 <size_t max_path> 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 |