]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
chore: Store config paths in lexically normal form
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 7 Nov 2024 20:54:32 +0000 (21:54 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 9 Nov 2024 12:59:05 +0000 (13:59 +0100)
src/ccache/config.cpp
src/ccache/config.hpp

index d6b6bad5128f5ec424e8fefc9b9278547e051180..8f596ea08be384d24d78d8b30f0a9f8ecb802925 100644 (file)
@@ -708,13 +708,13 @@ Config::system_config_path() const
 void
 Config::set_config_path(const fs::path& path)
 {
-  m_config_path = path;
+  m_config_path = util::lexically_normal(path);
 }
 
 void
 Config::set_system_config_path(const fs::path& path)
 {
-  m_system_config_path = path;
+  m_system_config_path = util::lexically_normal(path);
 }
 
 bool
index a527533bc2b638cf3ed3414094e66d6c1de4943a..2e15b4c04399263cddf93a14c2f7d78603fda9d0 100644 (file)
@@ -21,6 +21,7 @@
 #include <ccache/args.hpp>
 #include <ccache/core/sloppiness.hpp>
 #include <ccache/util/noncopyable.hpp>
+#include <ccache/util/path.hpp>
 #include <ccache/util/string.hpp>
 
 #include <sys/types.h>
@@ -533,13 +534,13 @@ Config::size_unit_prefix_type() const
 inline void
 Config::set_base_dir(const std::filesystem::path& value)
 {
-  m_base_dir = value;
+  m_base_dir = util::lexically_normal(value);
 }
 
 inline void
 Config::set_cache_dir(const std::filesystem::path& value)
 {
-  m_cache_dir = value;
+  m_cache_dir = util::lexically_normal(value);
   if (!m_temporary_dir_configured_explicitly) {
     m_temporary_dir = default_temporary_dir();
   }
@@ -626,5 +627,5 @@ Config::set_run_second_cpp(bool value)
 inline void
 Config::set_temporary_dir(const std::filesystem::path& value)
 {
-  m_temporary_dir = value;
+  m_temporary_dir = util::lexically_normal(value);
 }