diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-12-31 15:03:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-12-31 15:03:26 +0300 |
commit | 5e4d32a9ffa7157a40bbd4d1d821c6dad860af0d (patch) | |
tree | 66caad4b06353342a3933b0287255b1d95d3b7dd /source/blender/blenlib/intern/util.c | |
parent | d00d1f1c89f217e485e18020ff0bac087ffcd77f (diff) |
Improvements to File->External Data->Make Paths Relative & Make Paths Absolute,
made when testing peach blend files wont have path issues when sent to the renderfarm.
* log failed path conversions
* clean the path so //foo/../foo/ is removed (not sure why but some peach files had this problem)
Also added a function to util.c
BLI_cleanup_file, same as BLI_cleanup_dir but dosnt add a slash at the end.
Diffstat (limited to 'source/blender/blenlib/intern/util.c')
-rw-r--r-- | source/blender/blenlib/intern/util.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 7c94cc80847..d1b2efa28c7 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -777,6 +777,16 @@ int BLI_strcaseeq(char *a, char *b) { void BLI_cleanup_dir(const char *relabase, char *dir) { + BLI_cleanup_file(relabase, dir); +#ifdef WIN32 + strcat(dir, "\\"); +#else + strcat(dir, "/"); +#endif +} + +void BLI_cleanup_file(const char *relabase, char *dir) +{ short a; char *start, *eind; @@ -814,9 +824,7 @@ void BLI_cleanup_dir(const char *relabase, char *dir) dir[a] = 0; } } - - strcat(dir, "\\"); -#else +#else if(dir[0]=='.') { /* happens, for example in FILE_MAIN */ dir[0]= '/'; dir[1]= 0; @@ -850,8 +858,6 @@ void BLI_cleanup_dir(const char *relabase, char *dir) if (a<=0) break; } } - - strcat(dir, "/"); #endif } |