[Bf-blender-cvs] [6b7bee6] master: Fix for BLI_delete failing on files containing quotes

Campbell Barton noreply at git.blender.org
Mon May 26 02:24:41 CEST 2014


Commit: 6b7bee6cd7f904b55090b0fb39facb97d3c2321e
Author: Campbell Barton
Date:   Mon May 26 10:23:05 2014 +1000
https://developer.blender.org/rB6b7bee6cd7f904b55090b0fb39facb97d3c2321e

Fix for BLI_delete failing on files containing quotes

===================================================================

M	source/blender/blenlib/intern/fileops.c

===================================================================

diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 39475d7..5df4675 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -635,21 +635,15 @@ int   BLI_access(const char *filename, int mode)
  */
 int BLI_delete(const char *file, bool dir, bool recursive)
 {
-	if (strchr(file, '"')) {
-		printf("Error: not deleted file %s because of quote!\n", file);
+	if (recursive) {
+		return recursive_operation(file, NULL, NULL, delete_single_file, delete_callback_post);
+	}
+	else if (dir) {
+		return rmdir(file);
 	}
 	else {
-		if (recursive) {
-			return recursive_operation(file, NULL, NULL, delete_single_file, delete_callback_post);
-		}
-		else if (dir) {
-			return rmdir(file);
-		}
-		else {
-			return remove(file); //BLI_snprintf(str, sizeof(str), "/bin/rm -f \"%s\"", file);
-		}
+		return remove(file);
 	}
-	return -1;
 }
 
 /**




More information about the Bf-blender-cvs mailing list