home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / old / 5.4.6 < prev    next >
Encoding:
Internet Message Format  |  1999-07-28  |  4.8 KB

  1. To: vim-dev@vim.org
  2. Subject: patch 5.4.6
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. I got one confirmation that this fixes the problem, and noone said it caused
  8. new problems, thus I'll change the exprimental patch into an official one.
  9.  
  10. Patch 5.4.6
  11. Problem:    GTK GUI: Using ":gui" in the .gvimrc file caused an error.  Only
  12.             happens when the GUI forks.
  13. Solution:   Don't fork in a recursive call of gui_start().
  14. Files:      src/gui.c
  15.  
  16.  
  17. *** ../vim-5.4/src/gui.c    Sun Jul 25 22:02:00 1999
  18. --- src/gui.c    Thu Jul 29 10:40:21 1999
  19. ***************
  20. *** 32,49 ****
  21.   
  22.   /*
  23.    * gui_start -- Called when user wants to start the GUI.
  24.    */
  25.       void
  26.   gui_start()
  27.   {
  28. !     char_u  *old_term;
  29.   #if defined(UNIX) && !defined(__BEOS__)
  30. !     pid_t   pid = -1;
  31. !     int        dofork = TRUE;
  32.   #endif
  33.   #ifdef USE_GUI_GTK
  34.       int        pfd[2];
  35.   #endif
  36.   
  37.       old_term = vim_strsave(T_NAME);
  38.   
  39. --- 32,54 ----
  40.   
  41.   /*
  42.    * gui_start -- Called when user wants to start the GUI.
  43. +  *
  44. +  * Careful: This function can be called recursively when there is a ":gui"
  45. +  * command in the .gvimrc file.  Only the first call should fork, not the
  46. +  * recursive call.
  47.    */
  48.       void
  49.   gui_start()
  50.   {
  51. !     char_u    *old_term;
  52.   #if defined(UNIX) && !defined(__BEOS__)
  53. !     pid_t    pid = -1;
  54. !     int        dofork = TRUE;
  55.   #endif
  56.   #ifdef USE_GUI_GTK
  57.       int        pfd[2];
  58.   #endif
  59. +     static int    recursive = 0;
  60.   
  61.       old_term = vim_strsave(T_NAME);
  62.   
  63. ***************
  64. *** 64,72 ****
  65.       full_screen = FALSE;
  66.   
  67.   #if defined(UNIX) && !defined(__BEOS__)
  68. !     if (!gui.dofork || vim_strchr(p_go, GO_FORG))
  69.       dofork = FALSE;
  70.   #endif
  71.   
  72.   #ifdef USE_GUI_GTK
  73.       /*
  74. --- 69,78 ----
  75.       full_screen = FALSE;
  76.   
  77.   #if defined(UNIX) && !defined(__BEOS__)
  78. !     if (!gui.dofork || vim_strchr(p_go, GO_FORG) || recursive)
  79.       dofork = FALSE;
  80.   #endif
  81. +     ++recursive;
  82.   
  83.   #ifdef USE_GUI_GTK
  84.       /*
  85. ***************
  86. *** 96,102 ****
  87.       {
  88.           (void)close(pfd[0]);    /* child closes its read end */
  89.           termcapinit((char_u *)"builtin_gui");   /* goes to gui_init() */
  90. !         gui.starting = FALSE;
  91.           (void)write(pfd[1], &gui.in_use, sizeof(int));
  92.           (void)close(pfd[1]);
  93.           if (!gui.in_use)
  94. --- 102,108 ----
  95.       {
  96.           (void)close(pfd[0]);    /* child closes its read end */
  97.           termcapinit((char_u *)"builtin_gui");   /* goes to gui_init() */
  98. !         gui.starting = recursive - 1;
  99.           (void)write(pfd[1], &gui.in_use, sizeof(int));
  100.           (void)close(pfd[1]);
  101.           if (!gui.in_use)
  102. ***************
  103. *** 110,115 ****
  104. --- 116,122 ----
  105.   #ifdef AUTOCMD
  106.           apply_autocmds(EVENT_GUIENTER, NULL, NULL, FALSE, curbuf);
  107.   #endif
  108. +         --recursive;
  109.           return; /* child successfully started gui */
  110.       }
  111.       else        /* parent */
  112. ***************
  113. *** 134,140 ****
  114.   
  115.       {
  116.       termcapinit((char_u *)"builtin_gui");
  117. !     gui.starting = FALSE;
  118.       }
  119.   
  120.   
  121. --- 141,147 ----
  122.   
  123.       {
  124.       termcapinit((char_u *)"builtin_gui");
  125. !     gui.starting = recursive - 1;
  126.       }
  127.   
  128.   
  129. ***************
  130. *** 181,186 ****
  131. --- 188,194 ----
  132.       if (gui.in_use)
  133.       apply_autocmds(EVENT_GUIENTER, NULL, NULL, FALSE, curbuf);
  134.   #endif
  135. +     --recursive;
  136.   }
  137.   
  138.   /*
  139. *** ../vim-5.4/src/version.h    Thu Jul 29 11:48:02 1999
  140. --- src/version.h    Thu Jul 29 11:48:26 1999
  141. ***************
  142. *** 19,26 ****
  143.   #define VIM_VERSION_MINOR_STR        "4"
  144.   #define VIM_VERSION_BUILD         57
  145.   #define VIM_VERSION_BUILD_STR        "57"
  146. ! #define VIM_VERSION_PATCHLEVEL         5
  147. ! #define VIM_VERSION_PATCHLEVEL_STR    "5"
  148.   
  149.   /*
  150.    * VIM_VERSION_NODOT is used for the runtime directory name.
  151. --- 19,26 ----
  152.   #define VIM_VERSION_MINOR_STR        "4"
  153.   #define VIM_VERSION_BUILD         57
  154.   #define VIM_VERSION_BUILD_STR        "57"
  155. ! #define VIM_VERSION_PATCHLEVEL         6
  156. ! #define VIM_VERSION_PATCHLEVEL_STR    "6"
  157.   
  158.   /*
  159.    * VIM_VERSION_NODOT is used for the runtime directory name.
  160. ***************
  161. *** 30,35 ****
  162.    */
  163.   #define VIM_VERSION_NODOT    "vim54"
  164.   #define VIM_VERSION_SHORT    "5.4"
  165. ! #define VIM_VERSION_MEDIUM    "5.4.5"
  166. ! #define VIM_VERSION_LONG    "VIM - Vi IMproved 5.4.5 (1999 Jul 29)"
  167. ! #define VIM_VERSION_LONG_DATE    "VIM - Vi IMproved 5.4.5 (1999 Jul 29, compiled "
  168. --- 30,35 ----
  169.    */
  170.   #define VIM_VERSION_NODOT    "vim54"
  171.   #define VIM_VERSION_SHORT    "5.4"
  172. ! #define VIM_VERSION_MEDIUM    "5.4.6"
  173. ! #define VIM_VERSION_LONG    "VIM - Vi IMproved 5.4.6 (1999 Jul 29)"
  174. ! #define VIM_VERSION_LONG_DATE    "VIM - Vi IMproved 5.4.6 (1999 Jul 29, compiled "
  175.  
  176. --
  177. CUSTOMER:     Well, can you hang around a couple of minutes?  He won't be
  178.               long.
  179. MORTICIAN:    Naaah, I got to go on to Robinson's -- they've lost nine today.
  180. CUSTOMER:     Well, when is your next round?
  181. MORTICIAN:    Thursday.
  182. DEAD PERSON:  I think I'll go for a walk.
  183.                                   The Quest for the Holy Grail (Monty Python)
  184.  
  185. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  186.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  187.