[Bf-blender-cvs] [fbd889ec285] master: Fix T86544: better cleanup of path given as command line argument.

Bastien Montagne noreply at git.blender.org
Thu Jun 10 18:40:29 CEST 2021


Commit: fbd889ec285a55872a274d72fdd0caba0a163cf7
Author: Bastien Montagne
Date:   Thu Jun 10 18:37:46 2021 +0200
Branches: master
https://developer.blender.org/rBfbd889ec285a55872a274d72fdd0caba0a163cf7

Fix T86544: better cleanup of path given as command line argument.

When using non-default system separator in filename path, code would end up
with an absolute path mixing regular and alternative separator,
confusing the rest of the path manipulations later on.

So this commit add proper replacements of alternative separators, and
path normalization.

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

M	source/creator/creator_args.c

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

diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index 8b1ac05f086..43f23510927 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -1959,7 +1959,9 @@ static int arg_handle_load_file(int UNUSED(argc), const char **argv, void *data)
   }
 
   BLI_strncpy(filename, argv[0], sizeof(filename));
+  BLI_path_slash_native(filename);
   BLI_path_abs_from_cwd(filename, sizeof(filename));
+  BLI_path_normalize(NULL, filename);
 
   /* load the file */
   BKE_reports_init(&reports, RPT_PRINT);



More information about the Bf-blender-cvs mailing list