summaryrefslogtreecommitdiff
path: root/zen/resolve_path.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-02-07 00:18:30 +0000
committerB. Stack <bgstack15@gmail.com>2022-02-07 00:18:30 +0000
commit4cba562d787bfc92aeadbbc2ef199d4856523247 (patch)
tree374c62790fde0ce5514ef56750d0ff023d61b528 /zen/resolve_path.cpp
parentMerge branch 'b11.16' into 'master' (diff)
parent add upstream 11.17 (diff)
downloadFreeFileSync-4cba562d787bfc92aeadbbc2ef199d4856523247.tar.gz
FreeFileSync-4cba562d787bfc92aeadbbc2ef199d4856523247.tar.bz2
FreeFileSync-4cba562d787bfc92aeadbbc2ef199d4856523247.zip
Merge branch 'b11.17' into 'master'11.17
add upstream 11.17 See merge request opensource-tracking/FreeFileSync!41
Diffstat (limited to 'zen/resolve_path.cpp')
-rw-r--r--zen/resolve_path.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/zen/resolve_path.cpp b/zen/resolve_path.cpp
index 0a45646e..17d3b777 100644
--- a/zen/resolve_path.cpp
+++ b/zen/resolve_path.cpp
@@ -180,24 +180,14 @@ namespace
//expand volume name if possible, return original input otherwise
-Zstring expandVolumeName(Zstring pathPhrase) // [volname]:\folder [volname]\folder [volname]folder -> C:\folder
+Zstring expandVolumeName(Zstring pathPhrase) // [volname]:\folder [volname]\folder [volname]folder -> C:\folder
{
//we only expect the [.*] pattern at the beginning => do not touch dir names like "C:\somedir\[stuff]"
trim(pathPhrase, true, false);
+
if (startsWith(pathPhrase, Zstr('[')))
{
- const size_t posEnd = pathPhrase.find(Zstr(']'));
- if (posEnd != Zstring::npos)
- {
- Zstring volName = Zstring(pathPhrase.c_str() + 1, posEnd - 1);
- Zstring relPath = Zstring(pathPhrase.c_str() + posEnd + 1);
-
- if (startsWith(relPath, FILE_NAME_SEPARATOR))
- relPath = afterFirst(relPath, FILE_NAME_SEPARATOR, IfNotFoundReturn::none);
- else if (startsWith(relPath, Zstr(":\\"))) //Win-only
- relPath = afterFirst(relPath, Zstr('\\'), IfNotFoundReturn::none);
- return "/.../[" + volName + "]/" + relPath;
- }
+ return "/.../" + pathPhrase;
}
return pathPhrase;
}
bgstack15