[Bf-blender-cvs] [b51034b9cad] master: Asset system: use native slash for AssetLibraryIndex.indices_base_path

Campbell Barton noreply at git.blender.org
Wed Jan 25 00:00:07 CET 2023


Commit: b51034b9cad3dc148b7377180c81a3350651c04a
Author: Campbell Barton
Date:   Wed Jan 25 09:53:38 2023 +1100
Branches: master
https://developer.blender.org/rBb51034b9cad3dc148b7377180c81a3350651c04a

Asset system: use native slash for AssetLibraryIndex.indices_base_path

When constructing run-time paths native slashes are preferred as WIN32
doesn't have full support for forward slashes in paths.
It can also cause problems when performing exact matches on paths
which are normalized, where normalizing one of the paths makes
comparisons fail.

Using the system native slash would have avoided T103385.

===================================================================

M	source/blender/editors/asset/intern/asset_indexer.cc

===================================================================

diff --git a/source/blender/editors/asset/intern/asset_indexer.cc b/source/blender/editors/asset/intern/asset_indexer.cc
index e1350b3119e..dd02e65791b 100644
--- a/source/blender/editors/asset/intern/asset_indexer.cc
+++ b/source/blender/editors/asset/intern/asset_indexer.cc
@@ -472,7 +472,7 @@ struct AssetLibraryIndex {
     BLI_path_append(index_path, sizeof(index_path), "asset-library-indices");
 
     std::stringstream ss;
-    ss << std::setfill('0') << std::setw(16) << std::hex << hash() << "/";
+    ss << std::setfill('0') << std::setw(16) << std::hex << hash() << SEP_STR;
     BLI_path_append(index_path, sizeof(index_path), ss.str().c_str());
 
     indices_base_path = std::string(index_path);



More information about the Bf-blender-cvs mailing list