summaryrefslogtreecommitdiff
path: root/shared/long_path_prefix.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:10:11 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:10:11 +0200
commitc0cdb2ad99a1e2a6ade5ce76c91177a79258e669 (patch)
tree4701a015385d9a6a5a4ba99a8f1f5d400fff26b1 /shared/long_path_prefix.cpp
parent3.13 (diff)
downloadFreeFileSync-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.cpp10
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
bgstack15