Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-02-29 18:50:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-02-29 18:50:28 +0300
commit96247ce19ca08a9db3da83148851e897f725cb1b (patch)
tree47ac3326ec9d40add038246bc54af39f174e23b3 /source/blender/blenlib/intern/util.c
parent95b0176fdedd4ac4b891563fd88161d4213a0cc2 (diff)
* Made BLI_join_dirfile() check before adding a slash between dir and file so as not to get /foo///bar.blend
* Pointcache now uses the process id to construct the path for unsaved files. (so 2 or more blender's open wont try to read/write the same pointcache) * Temp pointcache is cleared when existing blender, added BIF_clear_tempfiles() for this. Should also be usedto clear EXR's in the temp dir (TODO), BIF_clear_tempfiles also needs to be added in more places. (On file load for instace)
Diffstat (limited to 'source/blender/blenlib/intern/util.c')
-rw-r--r--source/blender/blenlib/intern/util.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c
index 8480a9d6e06..4610c887476 100644
--- a/source/blender/blenlib/intern/util.c
+++ b/source/blender/blenlib/intern/util.c
@@ -1471,12 +1471,20 @@ void BLI_join_dirfile(char *string, const char *dir, const char *file)
int sl_dir = strlen(dir);
BLI_strncpy(string, dir, FILE_MAX);
if (sl_dir > FILE_MAX-1) sl_dir = FILE_MAX-1;
+
+ /* only add seperator if needed */
#ifdef WIN32
- string[sl_dir] = '\\';
+ if (string[sl_dir-1] != '\\') {
+ string[sl_dir] = '\\';
+ sl_dir++;
+ }
#else
- string[sl_dir] = '/';
+ if (string[sl_dir-1] != '/') {
+ string[sl_dir] = '/';
+ sl_dir++;
+ }
#endif
- sl_dir++;
+
if (sl_dir <FILE_MAX) {
BLI_strncpy(string + sl_dir, file, FILE_MAX-sl_dir);
}