diff options
author | B. Stack <bgstack15@gmail.com> | 2022-11-22 08:54:34 -0500 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-11-22 08:54:34 -0500 |
commit | a034cfca98d4408b175938740628a54f57eb7614 (patch) | |
tree | 501fd78c6276c0be8be8d2c671a58dd0598060b5 /zen/file_path.cpp | |
parent | add upstream 11.27 (diff) | |
download | FreeFileSync-11.28.tar.gz FreeFileSync-11.28.tar.bz2 FreeFileSync-11.28.zip |
add upstream 11.2811.28
Diffstat (limited to 'zen/file_path.cpp')
-rw-r--r-- | zen/file_path.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zen/file_path.cpp b/zen/file_path.cpp index 912d5a37..73a3e923 100644 --- a/zen/file_path.cpp +++ b/zen/file_path.cpp @@ -77,6 +77,8 @@ std::optional<Zstring> zen::getParentFolderPath(const Zstring& itemPath) Zstring zen::appendSeparator(Zstring path) //support rvalue references! { + assert(!endsWith(path, FILE_NAME_SEPARATOR == Zstr('/') ? Zstr('\\' ) : Zstr('/' ))); + if (!endsWith(path, FILE_NAME_SEPARATOR)) path += FILE_NAME_SEPARATOR; return path; //returning a by-value parameter => RVO if possible, r-value otherwise! @@ -156,8 +158,8 @@ Zstring zen::getFileExtension(const Zstring& filePath) std::weak_ordering zen::compareNativePath(const Zstring& lhs, const Zstring& rhs) { - assert(lhs.find(Zchar('\0')) == Zstring::npos); //don't expect embedded nulls! - assert(rhs.find(Zchar('\0')) == Zstring::npos); // + assert(!contains(lhs, Zchar('\0'))); //don't expect embedded nulls! + assert(!contains(rhs, Zchar('\0'))); // return lhs <=> rhs; |