diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-19 14:39:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-19 14:39:49 +0400 |
commit | 40c2f52dbf782d18a4819eb583ea3b297b6dfb77 (patch) | |
tree | 61fce7ce793304e3594897bbfe8e0f447560afe7 /source | |
parent | a15ac6ee09afb7f8bf68cbb60d2857243da4d40e (diff) |
code cleanup: simplify BLI_parent_dir using BLI_join_dirfile
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 1e76a7f3164..4c089e99202 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -610,9 +610,8 @@ bool BLI_parent_dir(char *path) { static char parent_dir[] = {'.', '.', SEP, '\0'}; /* "../" or "..\\" */ char tmp[FILE_MAX + 4]; - BLI_strncpy(tmp, path, sizeof(tmp) - 4); - BLI_add_slash(tmp); - strcat(tmp, parent_dir); + + BLI_join_dirfile(tmp, sizeof(tmp), path, parent_dir); BLI_cleanup_dir(NULL, tmp); /* does all the work of normalizing the path for us */ if (!BLI_testextensie(tmp, parent_dir)) { |