[Bf-blender-cvs] [7e9c347] master: Fix T45375: Cant clear temp fluid cache after closing Blender (Windows).

Bastien Montagne noreply at git.blender.org
Sun Jul 12 18:49:42 CEST 2015


Commit: 7e9c347c8c23b3e396b1ecfd418272c8a96a7096
Author: Bastien Montagne
Date:   Sun Jul 12 18:47:29 2015 +0200
Branches: master
https://developer.blender.org/rB7e9c347c8c23b3e396b1ecfd418272c8a96a7096

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. :|

===================================================================

M	source/blender/blenlib/intern/fileops.c

===================================================================

diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index c3e8898..5af59a3 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;
 			}




More information about the Bf-blender-cvs mailing list