2.5
authorTon Roosendaal <ton@blender.org>
Tue, 10 Feb 2009 09:49:36 +0000 (09:49 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 10 Feb 2009 09:49:36 +0000 (09:49 +0000)
Bugfix: CTRL+W "Save file" still gave a 'save over' popup when the
file didn't exist yet. It then attempted to free the operator twice.

source/blender/editors/interface/interface_regions.c

index 696fde4b512a833c670875b67473d998166b4786..1eb4588ac0b4e84583f2c12f82d06f52f730b2f0 100644 (file)
@@ -2301,16 +2301,15 @@ void uiPupMenuSaveOver(bContext *C, wmOperator *op, char *filename)
        if(len==0)
                return;
 
-       if(BLI_exists(filename)==0)
-               operator_cb(C, op, 1);
-
        if(filename[len-1]=='/' || filename[len-1]=='\\') {
                uiPupMenuError(C, "Cannot overwrite a directory");
                WM_operator_free(op);
                return;
        }
-
-       confirm_operator(C, op, "Save over", filename);
+       if(BLI_exists(filename)==0)
+               operator_cb(C, op, 1);
+       else
+               confirm_operator(C, op, "Save over", filename);
 }
 
 void uiPupMenuNotice(bContext *C, char *str, ...)