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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user