Fix for T37864, save/save_as blend now refuses to save and report an error, when filepath is not writeable.

This commit is contained in:
Thomas Dinges 2013-12-19 09:54:02 +01:00
parent dce82591a7
commit 01745d359e
1 changed files with 6 additions and 0 deletions

View 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,