]> granicus.if.org Git - vim/commitdiff
patch 7.4.1598 v7.4.1598
authorBram Moolenaar <Bram@vim.org>
Sat, 19 Mar 2016 13:48:31 +0000 (14:48 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 19 Mar 2016 13:48:31 +0000 (14:48 +0100)
Problem:    When starting the GUI fails a swap file is left behind. (Joerg
            Plate)
Solution:   Preserve files before exiting. (closes #692)

src/gui.c
src/main.c
src/version.c

index f52d217aa8e3619aaff627924ec82d7d20a5c2f7..d5c0d3e2249efdeeb190fcf1550ca63a0f9ae439 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -105,7 +105,7 @@ gui_start(void)
        /* If there is 'f' in 'guioptions' and specify -g argument,
         * gui_mch_init_check() was not called yet.  */
        if (gui_mch_init_check() != OK)
-           exit(1);
+           getout_preserve_modified(1);
 #endif
        gui_attempt_start();
     }
@@ -272,7 +272,7 @@ gui_do_fork(void)
 #ifdef FEAT_GUI_GTK
     /* Call gtk_init_check() here after fork(). See gui_init_check(). */
     if (gui_mch_init_check() != OK)
-       exit(1);
+       getout_preserve_modified(1);
 #endif
 
 # if defined(HAVE_SETSID) || defined(HAVE_SETPGID)
@@ -309,7 +309,7 @@ gui_do_fork(void)
 
     /* If we failed to start the GUI, exit now. */
     if (!gui.in_use)
-       exit(1);
+       getout_preserve_modified(1);
 }
 
 /*
index 8c7d3d68b1dff21b503e48d446ff121128a2b250..83e55d1a70185d7fec3b24a2315be8784ce2ff2a 100644 (file)
@@ -1355,7 +1355,7 @@ main_loop(
 }
 
 
-#if defined(USE_XSMP) || defined(FEAT_GUI_MSWIN) || defined(PROTO)
+#if defined(USE_XSMP) || defined(FEAT_GUI) || defined(PROTO)
 /*
  * Exit, but leave behind swap files for modified buffers.
  */
@@ -1377,7 +1377,9 @@ getout_preserve_modified(int exitval)
 #endif
 
 
-/* Exit properly */
+/*
+ * Exit properly.
+ */
     void
 getout(int exitval)
 {
index 4d0c25046b34f4e562dd99f141ea2a3b84a1fc55..73798755f2e877ee6c83dd3f95410e5973663d4c 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1598,
 /**/
     1597,
 /**/