Cleanup: remove redundant path functions

- BLI_path_normalize ran BLI_path_abs on a path that had already
  been made absolute.
- BLI_path_slash_ensure was called after BLI_path_normalize_dir
  which already ensures a slash.
This commit is contained in:
Campbell Barton
2023-04-24 11:25:56 +10:00
parent 993d24c174
commit 8b1c54cd50
2 changed files with 1 additions and 2 deletions

View File

@@ -137,7 +137,7 @@ static bool lib_id_library_local_paths_callback(BPathForeachPathData *bpath_data
/* Path was relative and is now absolute. Remap.
* Important BLI_path_normalize runs before the path is made relative
* because it won't work for paths that start with "//../" */
BLI_path_normalize(base_new, filepath);
BLI_path_normalize(NULL, filepath);
BLI_path_rel(filepath, base_new);
BLI_strncpy(r_path_dst, filepath, FILE_MAX);
return true;

View File

@@ -199,7 +199,6 @@ static FileSelect file_select_do(bContext *C, int selected_idx, bool do_diropen)
else if (file->redirection_path) {
BLI_strncpy(params->dir, file->redirection_path, sizeof(params->dir));
BLI_path_normalize_dir(BKE_main_blendfile_path(bmain), params->dir, sizeof(params->dir));
BLI_path_slash_ensure(params->dir, sizeof(params->dir));
}
else {
BLI_path_normalize_dir(BKE_main_blendfile_path(bmain), params->dir, sizeof(params->dir));