diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-04-26 17:08:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-04-26 17:08:57 +0400 |
commit | c8376869b1a521c903a6f8d1be49e48c2966df70 (patch) | |
tree | 6e3ff79d8b57303d5ea70a8211af78618cf40a78 /source/blender/blenlib/intern/bpath.c | |
parent | 19985ae918759780d3cf607a87b9fd110be518a0 (diff) |
BLI_split_dirfile was being used in cases it should not have been,
Added BLI_split_dirfile_basic, that only splits the path into directory and file. without checking the dir exists or creating it, without changing the original string that is passed to it.
Diffstat (limited to 'source/blender/blenlib/intern/bpath.c')
-rw-r--r-- | source/blender/blenlib/intern/bpath.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 4e4b47b2c92..05e8b08f2d1 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -259,22 +259,7 @@ void seq_setpath(struct BPathIterator *bpi, char *path) { if (SEQ_HAS_PATH(seq)) { if (seq->type == SEQ_IMAGE || seq->type == SEQ_MOVIE) { - - int lslash, i = 0; - for (i=0; path[i]!='\0'; i++) { - if (path[i]=='\\' || path[i]=='/') - lslash = i+1; - } - - if (lslash) { - BLI_strncpy( seq->strip->dir, path, lslash+1); /* +1 to include the slash and the last char */ - } else { - path[0] = '\0'; - } - - if (seq->strip->stripdata) { /* should always be true! */ - BLI_strncpy( seq->strip->stripdata->name, path+lslash, sizeof(seq->strip->stripdata->name)); - } + BLI_split_dirfile_basic(path, seq->strip->dir, seq->strip->stripdata->name); } else { /* simple case */ BLI_strncpy(seq->strip->dir, path, sizeof(seq->strip->dir)); @@ -657,7 +642,7 @@ void findMissingFiles(char *str) { waitcursor( 1 ); - BLI_split_dirfile(str, dirname, dummyname); + BLI_split_dirfile_basic(str, dirname, NULL); BLI_bpathIterator_init(&bpi); @@ -678,7 +663,7 @@ void findMissingFiles(char *str) { /* can the dir be opened? */ filesize = -1; recur_depth = 0; - BLI_split_dirfile(filepath, dummyname, filename); /* the file to find */ + BLI_split_dirfile_basic(filepath, NULL, filename); /* the file to find */ findFileRecursive(filename_new, dirname, filename, &filesize, &recur_depth); if (filesize == -1) { /* could not open dir */ |