diff options
author | Bastien Montagne <bastien@blender.org> | 2021-06-10 19:37:46 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-06-10 19:37:46 +0300 |
commit | fbd889ec285a55872a274d72fdd0caba0a163cf7 (patch) | |
tree | e777104ea4d10bf41eea7ed5c602c9604aac1693 /source/creator/creator_args.c | |
parent | 509e0c5b7677f4c2fdde264ccc5f376c1505219d (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/creator_args.c')
-rw-r--r-- | source/creator/creator_args.c | 2 |
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); |