diff options
author | Thomas Dinges <blender@dingto.org> | 2013-12-19 12:54:02 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-12-19 12:57:44 +0400 |
commit | 01745d359eda2f81f25aa23d76000af9e58f761b (patch) | |
tree | a504a672369290a7f7799ab95935676bb5b7c183 /source/blender/windowmanager/intern | |
parent | dce82591a7504cac25bc53d4f92ca234bf85c3aa (diff) |
Fix for T37864, save/save_as blend now refuses to save and report an error, when filepath is not writeable.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 09192c5c2ec..d92e61be76a 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, |