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 / 6.1.066 < prev    next >
Encoding:
Internet Message Format  |  2002-05-14  |  6.5 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.066 (extra)
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.1.066 (extra)
  11. Problem:    When calling system() in a plugin reading stdin hangs.
  12. Solution:   Don't set the terminal to RAW mode when it wasn't in RAW mode
  13.         before the system() call.
  14. Files:        src/os_amiga.c, src/os_msdos.c, src/os_riscos.c, src/os_unix.c,
  15.         src/os_win16.c, src/os_win32.c
  16.  
  17.  
  18. *** ../vim61.065/src/os_amiga.c    Mon Mar 11 21:48:28 2002
  19. --- src/os_amiga.c    Wed May 15 21:51:07 2002
  20. ***************
  21. *** 1129,1134 ****
  22. --- 1129,1135 ----
  23.   {
  24.       BPTR    mydir;
  25.       int        x;
  26. +     int        tmode = cur_tmode;
  27.   #ifdef AZTEC_C
  28.       int        use_execute;
  29.       char_u    *shellcmd = NULL;
  30. ***************
  31. *** 1315,1321 ****
  32.   
  33.       if (mydir = CurrentDir(mydir))    /* make sure we stay in the same directory */
  34.       UnLock(mydir);
  35. !     settmode(TMODE_RAW);        /* set to raw mode */
  36.   #ifdef FEAT_TITLE
  37.       resettitle();
  38.   #endif
  39. --- 1316,1323 ----
  40.   
  41.       if (mydir = CurrentDir(mydir))    /* make sure we stay in the same directory */
  42.       UnLock(mydir);
  43. !     if (tmode == TMODE_RAW)
  44. !     settmode(TMODE_RAW);        /* set to raw mode */
  45.   #ifdef FEAT_TITLE
  46.       resettitle();
  47.   #endif
  48. *** ../vim61.065/src/os_msdos.c    Mon Mar 11 21:46:29 2002
  49. --- src/os_msdos.c    Wed May 15 21:49:12 2002
  50. ***************
  51. *** 2103,2108 ****
  52. --- 2103,2109 ----
  53.       int        options)
  54.   {
  55.       int        x;
  56. +     int        tmode = cur_tmode;
  57.   #ifndef DJGPP
  58.       char_u    *newcmd;
  59.   #endif
  60. ***************
  61. *** 2152,2158 ****
  62.       signal(SIGQUIT, SIG_DFL);
  63.       signal(SIGTERM, SIG_DFL);
  64.   #endif
  65. !     settmode(TMODE_RAW);    /* set to raw mode */
  66.       set_interrupts(TRUE);    /* catch interrupts */
  67.   
  68.       if (x && !(options & SHELL_SILENT) && !emsg_silent)
  69. --- 2153,2160 ----
  70.       signal(SIGQUIT, SIG_DFL);
  71.       signal(SIGTERM, SIG_DFL);
  72.   #endif
  73. !     if (tmode == TMODE_RAW)
  74. !     settmode(TMODE_RAW);    /* set to raw mode */
  75.       set_interrupts(TRUE);    /* catch interrupts */
  76.   
  77.       if (x && !(options & SHELL_SILENT) && !emsg_silent)
  78. *** ../vim61.065/src/os_riscos.c    Mon Mar 11 22:10:01 2002
  79. --- src/os_riscos.c    Wed May 15 21:51:48 2002
  80. ***************
  81. *** 796,801 ****
  82. --- 796,802 ----
  83.       int        options;    /* SHELL_*, see vim.h */
  84.   {
  85.       int        retval;
  86. +     int        tmode = cur_tmode;
  87.   
  88.       if (cmd == NULL)
  89.       cmd = (char_u *) "GOS";
  90. ***************
  91. *** 816,822 ****
  92.       EMSG(strerror(EOPSYS));        /* Doesn't seem to set errno? */
  93.   
  94.       swi(OS_Byte, 229, 1, 0);        /* Re-disable escape */
  95. !     settmode(TMODE_RAW);        /* set to raw mode */
  96.       return retval ? FAIL : OK;
  97.   }
  98.   
  99. --- 817,824 ----
  100.       EMSG(strerror(EOPSYS));        /* Doesn't seem to set errno? */
  101.   
  102.       swi(OS_Byte, 229, 1, 0);        /* Re-disable escape */
  103. !     if (tmode == TMODE_RAW)
  104. !     settmode(TMODE_RAW);        /* set to raw mode */
  105.       return retval ? FAIL : OK;
  106.   }
  107.   
  108. *** ../vim61.065/src/os_unix.c    Sun May  5 14:35:03 2002
  109. --- src/os_unix.c    Wed May 15 21:53:03 2002
  110. ***************
  111. *** 2980,2985 ****
  112. --- 2980,2986 ----
  113.       char    *ifn = NULL;
  114.       char    *ofn = NULL;
  115.   #endif
  116. +     int        tmode = cur_tmode;
  117.   #ifdef USE_SYSTEM    /* use system() to start the shell: simple but slow */
  118.       int        x;
  119.   #ifndef __EMX__
  120. ***************
  121. *** 3074,3080 ****
  122.       msg_putchar('\n');
  123.       }
  124.   
  125. !     settmode(TMODE_RAW);        /* set to raw mode */
  126.   #ifdef FEAT_TITLE
  127.       resettitle();
  128.   #endif
  129. --- 3075,3082 ----
  130.       msg_putchar('\n');
  131.       }
  132.   
  133. !     if (tmode == TMODE_RAW)
  134. !     settmode(TMODE_RAW);    /* set to raw mode */
  135.   #ifdef FEAT_TITLE
  136.       resettitle();
  137.   #endif
  138. ***************
  139. *** 3667,3673 ****
  140.            * Set to raw mode right now, otherwise a CTRL-C after
  141.            * catch_signals() will kill Vim.
  142.            */
  143. !         settmode(TMODE_RAW);
  144.           did_settmode = TRUE;
  145.           set_signals();
  146.   
  147. --- 3669,3676 ----
  148.            * Set to raw mode right now, otherwise a CTRL-C after
  149.            * catch_signals() will kill Vim.
  150.            */
  151. !         if (tmode == TMODE_RAW)
  152. !         settmode(TMODE_RAW);
  153.           did_settmode = TRUE;
  154.           set_signals();
  155.   
  156. ***************
  157. *** 3698,3704 ****
  158.   
  159.   error:
  160.       if (!did_settmode)
  161. !     settmode(TMODE_RAW);            /* set to raw mode */
  162.   #ifdef FEAT_TITLE
  163.       resettitle();
  164.   #endif
  165. --- 3701,3708 ----
  166.   
  167.   error:
  168.       if (!did_settmode)
  169. !     if (tmode == TMODE_RAW)
  170. !         settmode(TMODE_RAW);    /* set to raw mode */
  171.   #ifdef FEAT_TITLE
  172.       resettitle();
  173.   #endif
  174. *** ../vim61.065/src/os_win16.c    Mon Aug 27 17:30:04 2001
  175. --- src/os_win16.c    Wed May 15 21:53:39 2002
  176. ***************
  177. *** 510,516 ****
  178.       char_u *cmd,
  179.       int options)        /* SHELL_, see vim.h */
  180.   {
  181. !     int        x;
  182.   
  183.       out_flush();
  184.   
  185. --- 510,517 ----
  186.       char_u *cmd,
  187.       int options)        /* SHELL_, see vim.h */
  188.   {
  189. !     int        x;
  190. !     int        tmode = cur_tmode;
  191.   
  192.       out_flush();
  193.   
  194. ***************
  195. *** 571,577 ****
  196.       }
  197.       }
  198.   
  199. !     settmode(TMODE_RAW);        /* set to raw mode */
  200.   
  201.       if (x && !(options & SHELL_SILENT) && !emsg_silent)
  202.       {
  203. --- 572,579 ----
  204.       }
  205.       }
  206.   
  207. !     if (tmode == TMODE_RAW)
  208. !     settmode(TMODE_RAW);    /* set to raw mode */
  209.   
  210.       if (x && !(options & SHELL_SILENT) && !emsg_silent)
  211.       {
  212. *** ../vim61.065/src/os_win32.c    Sat Apr 20 21:50:49 2002
  213. --- src/os_win32.c    Wed May 15 21:54:22 2002
  214. ***************
  215. *** 2865,2871 ****
  216.       char_u *cmd,
  217.       int options)    /* SHELL_*, see vim.h */
  218.   {
  219. !     int        x = 0;
  220.   #ifdef FEAT_TITLE
  221.       char szShellTitle[512];
  222.   
  223. --- 2873,2880 ----
  224.       char_u *cmd,
  225.       int options)    /* SHELL_*, see vim.h */
  226.   {
  227. !     int        x = 0;
  228. !     int        tmode = cur_tmode;
  229.   #ifdef FEAT_TITLE
  230.       char szShellTitle[512];
  231.   
  232. ***************
  233. *** 3026,3032 ****
  234.       }
  235.       }
  236.   
  237. !     settmode(TMODE_RAW);        /* set to raw mode */
  238.   
  239.       /* Print the return value, unless "vimrun" was used. */
  240.       if (x != 0 && !(options & SHELL_SILENT) && !emsg_silent
  241. --- 3035,3042 ----
  242.       }
  243.       }
  244.   
  245. !     if (tmode == TMODE_RAW)
  246. !     settmode(TMODE_RAW);    /* set to raw mode */
  247.   
  248.       /* Print the return value, unless "vimrun" was used. */
  249.       if (x != 0 && !(options & SHELL_SILENT) && !emsg_silent
  250. *** ../vim61.065/src/version.c    Wed May 15 21:02:09 2002
  251. --- src/version.c    Wed May 15 21:57:11 2002
  252. ***************
  253. *** 608,609 ****
  254. --- 608,611 ----
  255.   {   /* Add new patch number below this line */
  256. + /**/
  257. +     66,
  258.   /**/
  259.  
  260. -- 
  261. Shift happens.
  262.                 -- Doppler
  263.  
  264.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  265. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  266. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  267.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  268.