BLI_split_dirfile was being used in cases it should not have been,
[blender.git] / source / blender / blenlib / intern / bpath.c
index 4e4b47b2c927c58762d673e85270746bf1bedb82..05e8b08f2d1205bfa411f6f4cd2598f0b69793c1 100644 (file)
@@ -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 */