From fbd889ec285a55872a274d72fdd0caba0a163cf7 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 10 Jun 2021 18:37:46 +0200 Subject: [PATCH] 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. --- source/creator/creator_args.c | 2 ++ 1 file changed, 2 insertions(+) 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);