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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-06-10 19:37:46 +0300
committerBastien Montagne <bastien@blender.org>2021-06-10 19:37:46 +0300
commitfbd889ec285a55872a274d72fdd0caba0a163cf7 (patch)
treee777104ea4d10bf41eea7ed5c602c9604aac1693 /source/creator
parent509e0c5b7677f4c2fdde264ccc5f376c1505219d (diff)
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.
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/creator_args.c2
1 files changed, 2 insertions, 0 deletions
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);