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.2.016 < prev    next >
Encoding:
Internet Message Format  |  2003-10-13  |  5.1 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.016
  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.2.016
  11. Problem:    Using ":scscope find" with 'cscopequickfix' does not always split
  12.         the window. (Gary Johnson)
  13.         Win32: ":cscope add" could make the script that contains it
  14.         read-only until the corresponding ":cscope kill".
  15.         Errors during ":cscope add" may not be handled properly.
  16. Solution:   When using the quickfix window may need to split the window.
  17.         Avoid file handle inheritance for the script.
  18.         Check for a failed connection and/or process.  (Sergey Khorev)
  19. Files:        src/ex_cmds2.c, src/if_cscope.c
  20.  
  21.  
  22. *** ../vim-6.2.015/src/ex_cmds2.c    Thu May 29 11:26:29 2003
  23. --- src/ex_cmds2.c    Thu Jun 19 23:42:05 2003
  24. ***************
  25. *** 11,17 ****
  26. --- 11,26 ----
  27.    * ex_cmds2.c: some more functions for command line commands
  28.    */
  29.   
  30. + #if defined(WIN32) && defined(FEAT_CSCOPE)
  31. + # include <io.h>
  32. + #endif
  33.   #include "vim.h"
  34. + #if defined(WIN32) && defined(FEAT_CSCOPE)
  35. + # include <fcntl.h>
  36. + #endif
  37.   #include "version.h"
  38.   
  39.   static void    cmd_source __ARGS((char_u *fname, exarg_T *eap));
  40. ***************
  41. *** 2016,2021 ****
  42. --- 2025,2049 ----
  43.   #define SCRIPT_INO(id) (((struct scriptstuff *)script_names.ga_data)[(id) - 1].ino)
  44.   #endif
  45.   
  46. + #if defined(WIN32) && defined(FEAT_CSCOPE)
  47. + static FILE *fopen_noinh_readbin __ARGS((char *filename));
  48. + /*
  49. +  * Special function to open a file without handle inheritance.
  50. +  */
  51. +     static FILE *
  52. + fopen_noinh_readbin(filename)
  53. +     char    *filename;
  54. + {
  55. +     int    fd_tmp = open(filename, O_RDONLY | O_BINARY | O_NOINHERIT);
  56. +     if (fd_tmp == -1)
  57. +     return NULL;
  58. +     return fdopen(fd_tmp, READBIN);
  59. + }
  60. + #endif
  61.   /*
  62.    * do_source: Read the file "fname" and execute its lines as EX commands.
  63.    *
  64. ***************
  65. *** 2070,2076 ****
  66. --- 2098,2108 ----
  67.       goto theend;
  68.       }
  69.   
  70. + #if defined(WIN32) && defined(FEAT_CSCOPE)
  71. +     cookie.fp = fopen_noinh_readbin((char *)fname_exp);
  72. + #else
  73.       cookie.fp = mch_fopen((char *)fname_exp, READBIN);
  74. + #endif
  75.       if (cookie.fp == NULL && check_other)
  76.       {
  77.       /*
  78. ***************
  79. *** 2087,2093 ****
  80. --- 2119,2129 ----
  81.           *p = '.';
  82.           else
  83.           *p = '_';
  84. + #if defined(WIN32) && defined(FEAT_CSCOPE)
  85. +         cookie.fp = fopen_noinh_readbin((char *)fname_exp);
  86. + #else
  87.           cookie.fp = mch_fopen((char *)fname_exp, READBIN);
  88. + #endif
  89.       }
  90.       }
  91.   
  92. *** ../vim-6.2.015/src/if_cscope.c    Tue Jun  3 20:40:22 2003
  93. --- src/if_cscope.c    Sun Jun 22 17:10:23 2003
  94. ***************
  95. *** 517,523 ****
  96. --- 517,526 ----
  97.       {
  98.       if (cs_create_connection(i) == CSCOPE_FAILURE
  99.           || cs_read_prompt(i) == CSCOPE_FAILURE)
  100. +     {
  101. +         cs_release_csp(i, TRUE);
  102.           goto add_err;
  103. +     }
  104.   
  105.       if (p_csverbose)
  106.       {
  107. ***************
  108. *** 1095,1101 ****
  109. --- 1098,1116 ----
  110.       fclose(f);
  111.       /* '-' starts a new error list */
  112.       if (qf_init(tmp, (char_u *)"%f%*\\t%l%*\\t%m", *qfpos == '-') > 0)
  113. +     {
  114. + # ifdef FEAT_WINDOWS
  115. +         if (postponed_split != 0)
  116. +         {
  117. +         win_split(postponed_split > 0 ? postponed_split : 0, 0);
  118. + #  ifdef FEAT_SCROLLBIND
  119. +         curwin->w_p_scb = FALSE;
  120. + #  endif
  121. +         postponed_split = 0;
  122. +         }
  123. + # endif
  124.           qf_jump(0, 0, forceit);
  125. +     }
  126.       mch_remove(tmp);
  127.       vim_free(tmp);
  128.       return TRUE;
  129. ***************
  130. *** 1794,1802 ****
  131.   #endif
  132.           )
  133.           ;
  134. !     if (s > path && *s == '/'
  135.   #ifdef WIN32
  136. !     || s > path && *s == '\\'
  137.   #endif
  138.           )
  139.       ++s;
  140. --- 1809,1817 ----
  141.   #endif
  142.           )
  143.           ;
  144. !     if ((s > path && *s == '/')
  145.   #ifdef WIN32
  146. !     || (s > path && *s == '\\')
  147.   #endif
  148.           )
  149.       ++s;
  150. ***************
  151. *** 2081,2090 ****
  152.       /*
  153.        * Trying to exit normally (not sure whether it is fit to UNIX cscope
  154.        */
  155. !     (void)fputs("q\n", csinfo[i].to_fp);
  156. !     (void)fflush(csinfo[i].to_fp);
  157.       /* give cscope chance to exit normally */
  158. !     if (WaitForSingleObject(csinfo[i].hProc, 1000) == WAIT_TIMEOUT)
  159.       TerminateProcess(csinfo[i].hProc, 0);
  160.   #endif
  161.   
  162. --- 2096,2109 ----
  163.       /*
  164.        * Trying to exit normally (not sure whether it is fit to UNIX cscope
  165.        */
  166. !     if (csinfo[i].to_fp != NULL)
  167. !     {
  168. !     (void)fputs("q\n", csinfo[i].to_fp);
  169. !     (void)fflush(csinfo[i].to_fp);
  170. !     }
  171.       /* give cscope chance to exit normally */
  172. !     if (csinfo[i].hProc > 0
  173. !         && WaitForSingleObject(csinfo[i].hProc, 1000) == WAIT_TIMEOUT)
  174.       TerminateProcess(csinfo[i].hProc, 0);
  175.   #endif
  176.   
  177. *** ../vim-6.2.015/src/version.c    Mon Jun 30 22:18:22 2003
  178. --- src/version.c    Mon Jun 30 22:25:27 2003
  179. ***************
  180. *** 632,633 ****
  181. --- 632,635 ----
  182.   {   /* Add new patch number below this line */
  183. + /**/
  184. +     16,
  185.   /**/
  186.  
  187. -- 
  188. hundred-and-one symptoms of being an internet addict:
  189. 264. You turn to the teletext page "surfing report" and are surprised that it
  190.      is about sizes of waves and a weather forecast for seaside resorts.
  191.  
  192.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  193. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  194. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  195.  \\\     Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
  196.