summaryrefslogtreecommitdiff
path: root/zen/file_path.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-04-03 09:56:38 -0400
committerB. Stack <bgstack15@gmail.com>2023-04-03 09:56:38 -0400
commit765e1bb3bdeb5c49f08543c20206e55c772e6b80 (patch)
tree920f288910890016e540213fe65f2d6f38aa82be /zen/file_path.cpp
parentadd upstream 12.1 (diff)
downloadFreeFileSync-765e1bb3bdeb5c49f08543c20206e55c772e6b80.tar.gz
FreeFileSync-765e1bb3bdeb5c49f08543c20206e55c772e6b80.tar.bz2
FreeFileSync-765e1bb3bdeb5c49f08543c20206e55c772e6b80.zip
add upstream 12.212.2
Diffstat (limited to 'zen/file_path.cpp')
-rw-r--r--zen/file_path.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/zen/file_path.cpp b/zen/file_path.cpp
index 7ef78569..c9d6f236 100644
--- a/zen/file_path.cpp
+++ b/zen/file_path.cpp
@@ -23,7 +23,7 @@ std::optional<PathComponents> zen::parsePathComponents(const Zstring& itemPath)
Zstring rootPath(itemPathPf.begin(), rootWithSep ? it + 1 : it);
Zstring relPath(it + 1, itemPathPf.end());
- trim(relPath, true, true, [](Zchar c) { return c == FILE_NAME_SEPARATOR; });
+ trim(relPath, TrimSide::both, [](Zchar c) { return c == FILE_NAME_SEPARATOR; });
return PathComponents{std::move(rootPath), std::move(relPath)};
}
@@ -203,24 +203,11 @@ std::optional<Zstring> zen::getEnvironmentVar(const ZstringView name)
envVars = globalEnvVars.get();
}
- auto it = envVars->find(name);
+ const auto it = envVars->find(name);
if (it == envVars->end())
return {};
- Zstring value = it->second;
-
- //some postprocessing (good idea!? Is this even needed!?
- warn_static("let's find out!")
-#if 0
- trim(value); //remove leading, trailing blanks
-
- //remove leading, trailing double-quotes
- if (startsWith(value, Zstr('"')) &&
- endsWith (value, Zstr('"')) &&
- value.length() >= 2)
- value = Zstring(value.c_str() + 1, value.length() - 2);
-#endif
- return value;
+ return it->second;
}
bgstack15