diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-03-07 05:23:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-07 05:26:23 +0300 |
commit | 0964865568802aba62737d899d6721ef5c58b63a (patch) | |
tree | 7e85df6a34a192085f94d181ba53d268bc6c1632 /source/blender/windowmanager | |
parent | 8fb1ea857ffef370acb020f6573c165100923e1b (diff) |
Cleanup: replace BLI_make_file_string with BLI_join_dirfile where possible
Use 'BLI_join_dirfile' for joining paths that don't need to expand '//'.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 10 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_platform_support.c | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 1ce56ad2dfc..83355ecb786 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -1088,7 +1088,7 @@ void wm_history_file_read(void) return; } - BLI_make_file_string("/", name, cfgdir, BLENDER_HISTORY_FILE); + BLI_join_dirfile(name, sizeof(name), cfgdir, BLENDER_HISTORY_FILE); lines = BLI_file_read_as_lines(name); @@ -1144,7 +1144,7 @@ static void wm_history_file_write(void) return; } - BLI_make_file_string("/", name, user_config_dir, BLENDER_HISTORY_FILE); + BLI_join_dirfile(name, sizeof(name), user_config_dir, BLENDER_HISTORY_FILE); fp = BLI_fopen(name, "w"); if (fp) { @@ -1487,7 +1487,7 @@ void wm_autosave_location(char *filepath) } #endif - BLI_make_file_string("/", filepath, BKE_tempdir_base(), path); + BLI_join_dirfile(filepath, FILE_MAX, BKE_tempdir_base(), path); } void WM_autosave_init(wmWindowManager *wm) @@ -1559,7 +1559,7 @@ void wm_autosave_delete(void) if (BLI_exists(filename)) { char str[FILE_MAX]; - BLI_make_file_string("/", str, BKE_tempdir_base(), BLENDER_QUIT_FILE); + BLI_join_dirfile(str, sizeof(str), BKE_tempdir_base(), BLENDER_QUIT_FILE); /* if global undo; remove tempsave, otherwise rename */ if (U.uiflag & USER_GLOBALUNDO) { @@ -2439,7 +2439,7 @@ void WM_recover_last_session(bContext *C, ReportList *reports) { char filepath[FILE_MAX]; - BLI_make_file_string("/", filepath, BKE_tempdir_base(), BLENDER_QUIT_FILE); + BLI_join_dirfile(filepath, sizeof(filepath), BKE_tempdir_base(), BLENDER_QUIT_FILE); /* if reports==NULL, it's called directly without operator, we add a quick check here */ if (reports || BLI_exists(filepath)) { G.fileflags |= G_FILE_RECOVER; diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 7a05ef4b849..c428eefb028 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -358,7 +358,8 @@ void WM_init(bContext *C, int argc, const char **argv) /* allow a path of "", this is what happens when making a new file */ #if 0 if (BKE_main_blendfile_path_from_global()[0] == '\0') { - BLI_make_file_string("/", G_MAIN->name, BKE_appdir_folder_default(), "untitled.blend"); + BLI_join_dirfile( + G_MAIN->name, sizeof(G_MAIN->name), BKE_appdir_folder_default(), "untitled.blend"); } #endif @@ -495,7 +496,7 @@ void WM_exit_ex(bContext *C, const bool do_python) bool has_edited; int fileflags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_HISTORY); - BLI_make_file_string("/", filename, BKE_tempdir_base(), BLENDER_QUIT_FILE); + BLI_join_dirfile(filename, sizeof(filename), BKE_tempdir_base(), BLENDER_QUIT_FILE); has_edited = ED_editors_flush_edits(bmain); diff --git a/source/blender/windowmanager/intern/wm_platform_support.c b/source/blender/windowmanager/intern/wm_platform_support.c index 94eceafc59b..73ba4b550c9 100644 --- a/source/blender/windowmanager/intern/wm_platform_support.c +++ b/source/blender/windowmanager/intern/wm_platform_support.c @@ -55,7 +55,7 @@ static bool wm_platform_support_check_approval(const char *platform_support_key, if (cfgdir) { char filepath[FILE_MAX]; - BLI_make_file_string("/", filepath, cfgdir, BLENDER_PLATFORM_SUPPORT_FILE); + BLI_join_dirfile(filepath, sizeof(filepath), cfgdir, BLENDER_PLATFORM_SUPPORT_FILE); LinkNode *lines = BLI_file_read_as_lines(filepath); for (LinkNode *line_node = lines; line_node; line_node = line_node->next) { char *line = line_node->link; |