To: vim_dev@googlegroups.com Subject: Patch 7.4.1598 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1598 Problem: When starting the GUI fails a swap file is left behind. (Joerg Plate) Solution: Preserve files before exiting. (closes #692) Files: src/main.c, src/gui.c *** ../vim-7.4.1597/src/main.c 2016-03-12 22:11:34.255300112 +0100 --- src/main.c 2016-03-19 14:42:52.551189973 +0100 *************** *** 1355,1361 **** } ! #if defined(USE_XSMP) || defined(FEAT_GUI_MSWIN) || defined(PROTO) /* * Exit, but leave behind swap files for modified buffers. */ --- 1355,1361 ---- } ! #if defined(USE_XSMP) || defined(FEAT_GUI) || defined(PROTO) /* * Exit, but leave behind swap files for modified buffers. */ *************** *** 1377,1383 **** #endif ! /* Exit properly */ void getout(int exitval) { --- 1377,1385 ---- #endif ! /* ! * Exit properly. ! */ void getout(int exitval) { *** ../vim-7.4.1597/src/gui.c 2016-03-15 23:10:26.412712095 +0100 --- src/gui.c 2016-03-19 14:44:52.117938512 +0100 *************** *** 105,111 **** /* 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); #endif gui_attempt_start(); } --- 105,111 ---- /* If there is 'f' in 'guioptions' and specify -g argument, * gui_mch_init_check() was not called yet. */ if (gui_mch_init_check() != OK) ! getout_preserve_modified(1); #endif gui_attempt_start(); } *************** *** 272,278 **** #ifdef FEAT_GUI_GTK /* Call gtk_init_check() here after fork(). See gui_init_check(). */ if (gui_mch_init_check() != OK) ! exit(1); #endif # if defined(HAVE_SETSID) || defined(HAVE_SETPGID) --- 272,278 ---- #ifdef FEAT_GUI_GTK /* Call gtk_init_check() here after fork(). See gui_init_check(). */ if (gui_mch_init_check() != OK) ! getout_preserve_modified(1); #endif # if defined(HAVE_SETSID) || defined(HAVE_SETPGID) *************** *** 309,315 **** /* If we failed to start the GUI, exit now. */ if (!gui.in_use) ! exit(1); } /* --- 309,315 ---- /* If we failed to start the GUI, exit now. */ if (!gui.in_use) ! getout_preserve_modified(1); } /* *** ../vim-7.4.1597/src/version.c 2016-03-19 14:22:05.476232243 +0100 --- src/version.c 2016-03-19 14:43:46.438625941 +0100 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1598, /**/ -- hundred-and-one symptoms of being an internet addict: 86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///