Cycles: svn merge -r41157:41182 ^/trunk/blender
[blender.git] / source / blender / blenloader / intern / writefile.c
index 7387b2d5d53f9f6c884d52d554e9cf7ab45a91f5..8f179bd240bc5788d2fb85fd25c40e302c0d9148 100644 (file)
@@ -872,7 +872,7 @@ static void write_pointcaches(WriteData *wd, ListBase *ptcaches)
                                
                                for(i=0; i<BPHYS_TOT_DATA; i++) {
                                        if(pm->data[i] && pm->data_types & (1<<i)) {
-                                               if(strcmp(ptcache_data_struct[i], "")==0)
+                                               if(ptcache_data_struct[i][0]=='\0')
                                                        writedata(wd, DATA, MEM_allocN_len(pm->data[i]), pm->data[i]);
                                                else
                                                        writestruct(wd, DATA, ptcache_data_struct[i], pm->totpoint, pm->data[i]);
@@ -880,7 +880,7 @@ static void write_pointcaches(WriteData *wd, ListBase *ptcaches)
                                }
 
                                for(; extra; extra=extra->next) {
-                                       if(strcmp(ptcache_extra_struct[extra->type], "")==0)
+                                       if(ptcache_extra_struct[extra->type][0]=='\0')
                                                continue;
                                        writestruct(wd, DATA, "PTCacheExtra", 1, extra);
                                        writestruct(wd, DATA, ptcache_extra_struct[extra->type], extra->totdata, extra->data);
@@ -2690,8 +2690,8 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
        if(write_flags & G_FILE_RELATIVE_REMAP) {
                char dir1[FILE_MAXDIR+FILE_MAXFILE];
                char dir2[FILE_MAXDIR+FILE_MAXFILE];
-               BLI_split_dirfile(filepath, dir1, NULL, sizeof(dir1), 0);
-               BLI_split_dirfile(mainvar->name, dir2, NULL, sizeof(dir2), 0);
+               BLI_split_dir_part(filepath, dir1, sizeof(dir1));
+               BLI_split_dir_part(mainvar->name, dir2, sizeof(dir2));
 
                /* just incase there is some subtle difference */
                BLI_cleanup_dir(mainvar->name, dir1);
@@ -2711,6 +2711,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
                }
        }
 
+       userfilename[0]= '\0'; /* ensure its initialized */
        BLI_make_file_string(G.main->name, userfilename, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_STARTUP_FILE);
        write_user_block= (BLI_path_cmp(filepath, userfilename) == 0);