diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-07-12 19:47:29 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-07-12 19:49:02 +0300 |
commit | 7e9c347c8c23b3e396b1ecfd418272c8a96a7096 (patch) | |
tree | 7d23d7a336c290a5db7449da1328f36f4432c25a /source | |
parent | d54e77b66dcb8aaf2dc567c1fce900b3b13ce465 (diff) |
Fix T45375: Cant clear temp fluid cache after closing Blender (Windows).
There was two different issues here actually:
* Own (very high) stupidity only gave 8 chars to file name (sic).
* list dir returns dirpaths without a trailing slahs, but expects them to have it it seems. :|
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index c3e889842c1..5af59a32e09 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -314,12 +314,20 @@ static bool delete_recursive(const char *dir) i = nbr = BLI_filelist_dir_contents(dir, &filelist); fl = filelist; while (i--) { - char file[8]; + char file[FILE_MAXFILE]; + BLI_split_file_part(fl->path, file, sizeof(file)); + if (FILENAME_IS_CURRPAR(file)) { /* Skip! */ } else if (S_ISDIR(fl->type)) { + char path[FILE_MAXDIR]; + + /* dir listing produces dir path without trailing slash... */ + BLI_strncpy(path, fl->path, sizeof(path)); + BLI_add_slash(path); + if (delete_recursive(fl->path)) { err = true; } |