[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57739] trunk/blender/source/blender: Fix #35824: finding missing files not working correct for filepaths with special

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Jun 25 16:48:31 CEST 2013


Revision: 57739
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57739
Author:   blendix
Date:     2013-06-25 14:48:30 +0000 (Tue, 25 Jun 2013)
Log Message:
-----------
Fix #35824: finding missing files not working correct for filepaths with special
characters on Windows.

Replaced some uses of stat() by BLI_stat() to properly handle such filepaths.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/bpath.c
    trunk/blender/source/blender/blenkernel/intern/packedFile.c
    trunk/blender/source/blender/blenlib/intern/fileops.c
    trunk/blender/source/blender/editors/space_file/filesel.c
    trunk/blender/source/blender/editors/space_text/text_ops.c
    trunk/blender/source/blender/imbuf/intern/thumbs.c
    trunk/blender/source/blender/imbuf/intern/util.c

Modified: trunk/blender/source/blender/blenkernel/intern/bpath.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/bpath.c	2013-06-25 14:31:52 UTC (rev 57738)
+++ trunk/blender/source/blender/blenkernel/intern/bpath.c	2013-06-25 14:48:30 UTC (rev 57739)
@@ -235,7 +235,7 @@
 
 		BLI_join_dirfile(path, sizeof(path), dirname, de->d_name);
 
-		if (stat(path, &status) != 0)
+		if (BLI_stat(path, &status) != 0)
 			continue;  /* cant stat, don't bother with this file, could print debug info here */
 
 		if (S_ISREG(status.st_mode)) { /* is file */

Modified: trunk/blender/source/blender/blenkernel/intern/packedFile.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/packedFile.c	2013-06-25 14:31:52 UTC (rev 57738)
+++ trunk/blender/source/blender/blenkernel/intern/packedFile.c	2013-06-25 14:48:30 UTC (rev 57739)
@@ -378,7 +378,7 @@
 	BLI_strncpy(name, filename, sizeof(name));
 	BLI_path_abs(name, G.main->name);
 	
-	if (stat(name, &st)) {
+	if (BLI_stat(name, &st)) {
 		ret_val = PF_NOFILE;
 	}
 	else if (st.st_size != pf->size) {

Modified: trunk/blender/source/blender/blenlib/intern/fileops.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/fileops.c	2013-06-25 14:31:52 UTC (rev 57738)
+++ trunk/blender/source/blender/blenlib/intern/fileops.c	2013-06-25 14:48:30 UTC (rev 57739)
@@ -251,7 +251,7 @@
 			fclose(ufopen(filename, "a"));
 
 		/* temporary #if until we update all libraries to 1.2.7
-		 * for  correct wide char path handling */
+		 * for correct wide char path handling */
 #if ZLIB_VERNUM >= 0x1270 && !defined(FREE_WINDOWS)
 		UTF16_ENCODE(filename);
 

Modified: trunk/blender/source/blender/editors/space_file/filesel.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/filesel.c	2013-06-25 14:31:52 UTC (rev 57738)
+++ trunk/blender/source/blender/editors/space_file/filesel.c	2013-06-25 14:48:30 UTC (rev 57739)
@@ -667,7 +667,7 @@
 					
 					BLI_join_dirfile(path, sizeof(path), dirname, de->d_name);
 
-					if (stat(path, &status) == 0) {
+					if (BLI_stat(path, &status) == 0) {
 						if (S_ISDIR(status.st_mode)) { /* is subdir */
 							autocomplete_do_name(autocpl, path);
 						}

Modified: trunk/blender/source/blender/editors/space_text/text_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_text/text_ops.c	2013-06-25 14:31:52 UTC (rev 57738)
+++ trunk/blender/source/blender/editors/space_text/text_ops.c	2013-06-25 14:48:30 UTC (rev 57739)
@@ -486,7 +486,7 @@
 	
 	fclose(fp);
 
-	if (stat(filepath, &st) == 0) {
+	if (BLI_stat(filepath, &st) == 0) {
 		text->mtime = st.st_mtime;
 	}
 	else {
@@ -3107,7 +3107,7 @@
 	if (!BLI_exists(file))
 		return 2;
 
-	result = stat(file, &st);
+	result = BLI_stat(file, &st);
 	
 	if (result == -1)
 		return -1;
@@ -3134,7 +3134,7 @@
 
 	if (!BLI_exists(file)) return;
 
-	result = stat(file, &st);
+	result = BLI_stat(file, &st);
 	
 	if (result == -1 || (st.st_mode & S_IFMT) != S_IFREG)
 		return;

Modified: trunk/blender/source/blender/imbuf/intern/thumbs.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/thumbs.c	2013-06-25 14:31:52 UTC (rev 57738)
+++ trunk/blender/source/blender/imbuf/intern/thumbs.c	2013-06-25 14:48:30 UTC (rev 57739)
@@ -319,7 +319,7 @@
 				}
 
 				if (img != NULL) {
-					stat(path, &info);
+					BLI_stat(path, &info);
 					BLI_snprintf(mtime, sizeof(mtime), "%ld", (long int)info.st_mtime);
 					BLI_snprintf(cwidth, sizeof(cwidth), "%d", img->x);
 					BLI_snprintf(cheight, sizeof(cheight), "%d", img->y);
@@ -339,7 +339,7 @@
 					}
 					IMB_free_anim(anim);
 				}
-				stat(path, &info);
+				BLI_stat(path, &info);
 				BLI_snprintf(mtime, sizeof(mtime), "%ld", (long int)info.st_mtime);
 			}
 			if (!img) return NULL;

Modified: trunk/blender/source/blender/imbuf/intern/util.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/util.c	2013-06-25 14:31:52 UTC (rev 57738)
+++ trunk/blender/source/blender/imbuf/intern/util.c	2013-06-25 14:48:30 UTC (rev 57739)
@@ -164,7 +164,7 @@
 
 	if (UTIL_DEBUG) printf("IMB_ispic_name: loading %s\n", name);
 	
-	if (stat(name, &st) == -1)
+	if (BLI_stat(name, &st) == -1)
 		return FALSE;
 	if (((st.st_mode) & S_IFMT) != S_IFREG)
 		return FALSE;




More information about the Bf-blender-cvs mailing list