aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/filesystem.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-03-27 14:09:01 +0100
committerGitHub Enterprise <[email protected]>2025-03-27 14:09:01 +0100
commita0a0dba13317533f882a85b7f4087588cfa09066 (patch)
tree3efc4c88f184a4ea8fa2d845584d74f561efb153 /src/zencore/filesystem.cpp
parentzen build cache service (#318) (diff)
downloadzen-a0a0dba13317533f882a85b7f4087588cfa09066.tar.xz
zen-a0a0dba13317533f882a85b7f4087588cfa09066.zip
optional compress of block chunks (#326)
- Feature: zenserver: Add command line option `--gc-buildstore-duration-seconds` to control GC life time of build store data - Improvement: ELF and MachO executable files are no longer chunked - Improvement: Compress chunks in blocks that encloses a full file (such as small executables) - Bugfix: Strip path delimiter at end of string in StringToPath
Diffstat (limited to 'src/zencore/filesystem.cpp')
-rw-r--r--src/zencore/filesystem.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp
index 05e2bf049..8a369f02e 100644
--- a/src/zencore/filesystem.cpp
+++ b/src/zencore/filesystem.cpp
@@ -2046,14 +2046,17 @@ SetFileReadOnly(const std::filesystem::path& Filename, bool ReadOnly)
std::filesystem::path
StringToPath(const std::string_view& Path)
{
+ std::string_view UnquotedPath = Path;
+
if (Path.length() > 2 && Path.front() == '\"' && Path.back() == '\"')
{
- return std::filesystem::path(Path.substr(1, Path.length() - 2)).make_preferred();
+ UnquotedPath = Path.substr(1, Path.length() - 2);
}
- else
+ if (UnquotedPath.ends_with('/') || UnquotedPath.ends_with('\\') || UnquotedPath.ends_with(std::filesystem::path::preferred_separator))
{
- return std::filesystem::path(Path).make_preferred();
+ UnquotedPath = UnquotedPath.substr(0, UnquotedPath.length() - 1);
}
+ return std::filesystem::path(UnquotedPath).make_preferred();
}
//////////////////////////////////////////////////////////////////////////