Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-05-26 04:23:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-05-26 04:23:05 +0400
commit6b7bee6cd7f904b55090b0fb39facb97d3c2321e (patch)
tree97efa96cded457d6c7fad1d17615618c14119554 /source/blender/blenlib/intern/fileops.c
parenta1d286a6995ec1a1bf5d74fb1cc7152e51654e1f (diff)
Fix for BLI_delete failing on files containing quotes
Diffstat (limited to 'source/blender/blenlib/intern/fileops.c')
-rw-r--r--source/blender/blenlib/intern/fileops.c18
1 files changed, 6 insertions, 12 deletions
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;
}
/**