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. :|
This commit is contained in:
Bastien Montagne 2015-07-12 18:47:29 +02:00
parent d54e77b66d
commit 7e9c347c8c
Notes: blender-bot 2023-07-10 10:12:37 +02:00
Referenced by issue #45375, Cant clear temp fluid cache after closing Blender
1 changed files with 9 additions and 1 deletions

View File

@ -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;
}