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:
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user