[Bf-blender-cvs] [01745d3] master: Fix for T37864, save/save_as blend now refuses to save and report an error, when filepath is not writeable.
Thomas Dinges
noreply at git.blender.org
Thu Dec 19 09:57:52 CET 2013
Commit: 01745d359eda2f81f25aa23d76000af9e58f761b
Author: Thomas Dinges
Date: Thu Dec 19 09:54:02 2013 +0100
http://developer.blender.org/rB01745d359eda2f81f25aa23d76000af9e58f761b
Fix for T37864, save/save_as blend now refuses to save and report an error, when filepath is not writeable.
===================================================================
M source/blender/windowmanager/intern/wm_files.c
===================================================================
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 09192c5..d92e61b 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -881,6 +881,12 @@ int wm_file_write(bContext *C, const char *filepath, int fileflags, ReportList *
BKE_report(reports, RPT_ERROR, "Path too long, cannot save");
return -1;
}
+
+ /* Check if file write permission is ok */
+ if (!BLI_file_is_writable(filepath)) {
+ BKE_reportf(reports, RPT_ERROR, "Cannot save blend file, path '%s' is not writable", filepath);
+ return -1;
+ }
/* note: used to replace the file extension (to ensure '.blend'),
* no need to now because the operator ensures,
More information about the Bf-blender-cvs
mailing list