From 6b7bee6cd7f904b55090b0fb39facb97d3c2321e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 26 May 2014 10:23:05 +1000 Subject: Fix for BLI_delete failing on files containing quotes --- source/blender/blenlib/intern/fileops.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'source/blender/blenlib/intern/fileops.c') diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 39475d73ee0..5df46752e3b 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; } /** -- cgit v1.2.3