Fix for T37864, save/save_as blend now refuses to save and report an error, when...
authorThomas Dinges <blender@dingto.org>
Thu, 19 Dec 2013 08:54:02 +0000 (09:54 +0100)
committerThomas Dinges <blender@dingto.org>
Thu, 19 Dec 2013 08:57:44 +0000 (09:57 +0100)
source/blender/windowmanager/intern/wm_files.c

index 09192c5c2ec0f985ded1a7bc1b06588924585416..d92e61be76a43ca0adef6dfc654f7eed9115c042 100644 (file)
@@ -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,