Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/elfmz/far2l.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorelfmz <fenix1905@tut.by>2021-10-17 01:04:49 +0300
committerelfmz <fenix1905@tut.by>2021-10-17 01:04:49 +0300
commit43cdf3226133c49260bf18640a77ce30b48a4886 (patch)
tree2809c7450be64b989b1d80a13eb6d209e7819233 /utils
parentb997ccabb62d21a5298089ff1d8e4dabd3319cb9 (diff)
NetRocks/SCP: some fixes with file times etc (fix #1107)
Diffstat (limited to 'utils')
-rw-r--r--utils/include/utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/include/utils.h b/utils/include/utils.h
index d5e76624..8441d6a3 100644
--- a/utils/include/utils.h
+++ b/utils/include/utils.h
@@ -151,6 +151,16 @@ template <class CharT>
}
template <class CharT>
+ std::basic_string<CharT> EnsureNoSlashAtNestedEnd(std::basic_string<CharT> str, CharT slash = '/')
+{
+ for (size_t p = str.size(); p > 1 && str[p - 1] == slash; ) {
+ str.resize(--p);
+ }
+ return str;
+}
+
+
+template <class CharT>
std::basic_string<CharT> EnsureSlashAtEnd(std::basic_string<CharT> str, CharT slash = '/')
{
const size_t p = str.size();