diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-29 08:26:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-29 08:26:40 +0400 |
commit | 567e13b2bb12390fa26f43dc2bd30b7cbf3ed851 (patch) | |
tree | d0b4c7e95046197982d796f38cdc9d2d0fa5474a /source/blender/windowmanager/intern/wm_files.c | |
parent | 4d83f957b57e469d0b8d22f30fd1b0470a4d24a0 (diff) |
don't replace the extension with '.blend' in save code since the file selector already ensures this,
needed so python scripts can save as temp filenames.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index f4b50667b2f..abda68d8b24 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -810,15 +810,14 @@ int write_crash_blend(void) } } -int wm_file_write(bContext *C, const char *target, int fileflags, ReportList *reports) +int wm_file_write(bContext *C, const char *filepath, int fileflags, ReportList *reports) { Library *li; int len; - char filepath[FILE_MAX]; int *thumb = NULL; ImBuf *ibuf_thumb = NULL; - len = strlen(target); + len = strlen(filepath); if (len == 0) { BKE_report(reports, RPT_ERROR, "Path is empty, cannot save"); @@ -830,9 +829,9 @@ int wm_file_write(bContext *C, const char *target, int fileflags, ReportList *re return -1; } - BLI_strncpy(filepath, target, FILE_MAX); - BLI_replace_extension(filepath, FILE_MAX, ".blend"); - /* don't use 'target' anymore */ + /* note: used to replace the file extension (to ensure '.blend'), + * no need to now because the operator ensures, + * its handy for scripts to save to a predefined name without blender editing it */ /* send the OnSave event */ for (li = G.main->library.first; li; li = li->id.next) { |