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.348 < prev    next >
Encoding:
Internet Message Format  |  2003-02-19  |  3.7 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.348
  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.348
  11. Problem:    Wildmode with wildmenu: ":set wildmode=list,full", ":colorscheme
  12.         <tab>" results in "zellner" instead of the first entry. (Anand
  13.         Hariharan)
  14. Solution:   Don't call ExpandOne() from globpath(). (Flemming Madsen)
  15. Files:        src/ex_getln.c
  16.  
  17.  
  18. *** ../vim61.347/src/ex_getln.c    Thu Jan  2 21:11:08 2003
  19. --- src/ex_getln.c    Mon Feb 17 21:12:21 2003
  20. ***************
  21. *** 3454,3473 ****
  22.       expand_T    xpc;
  23.       char_u    *buf;
  24.       garray_T    ga;
  25.       int        len;
  26. !     char_u    *p;
  27. !     char_u    **save_cmd_files = cmd_files;
  28. !     int        save_cmd_numfiles = cmd_numfiles;
  29.   
  30.       buf = alloc(MAXPATHL);
  31.       if (buf == NULL)
  32.       return NULL;
  33.   
  34. -     /* ExpandOne() uses cmd_files and cmd_numfiles, need to save and restore
  35. -      * them. */
  36. -     cmd_files = NULL;
  37. -     cmd_numfiles = -1;
  38.       xpc.xp_context = EXPAND_FILES;
  39.       xpc.xp_backslash = XP_BS_NONE;
  40.       ga_init2(&ga, 1, 100);
  41. --- 3454,3469 ----
  42.       expand_T    xpc;
  43.       char_u    *buf;
  44.       garray_T    ga;
  45. +     int        i;
  46.       int        len;
  47. !     int        num_p;
  48. !     char_u    **p;
  49. !     char_u    *cur = NULL;
  50.   
  51.       buf = alloc(MAXPATHL);
  52.       if (buf == NULL)
  53.       return NULL;
  54.   
  55.       xpc.xp_context = EXPAND_FILES;
  56.       xpc.xp_backslash = XP_BS_NONE;
  57.       ga_init2(&ga, 1, 100);
  58. ***************
  59. *** 3481,3520 ****
  60.       {
  61.           add_pathsep(buf);
  62.           STRCAT(buf, file);
  63. !         p = ExpandOne(&xpc, buf, NULL, WILD_USE_NL|WILD_SILENT, WILD_ALL);
  64. !         if (p != NULL)
  65.           {
  66. !         len = (int)STRLEN(p);
  67. !         if (ga.ga_data == NULL)
  68. !         {
  69. !             ga.ga_data = p;
  70. !             ga.ga_room = 0;
  71. !             ga.ga_len = len + 1;
  72. !         }
  73. !         else
  74.           {
  75. !             /* Concatenate new results to previous ones.  Insert a NL
  76. !              * and keep room for the trailing NUL. */
  77. !             ++len;
  78. !             if (ga_grow(&ga, len + 1) == OK)
  79.               {
  80. !             STRCAT(ga.ga_data, "\n");
  81. !             STRCAT(ga.ga_data, p);
  82. !             ga.ga_len += len;
  83. !             ga.ga_room -= len;
  84.               }
  85. !             vim_free(p);
  86.           }
  87.           }
  88.       }
  89.       }
  90. !     vim_free(buf);
  91.   
  92. !     FreeWild(cmd_numfiles, cmd_files);
  93. !     cmd_files = save_cmd_files;
  94. !     cmd_numfiles = save_cmd_numfiles;
  95. !     return ga.ga_data;
  96.   }
  97.   
  98.   #endif
  99. --- 3477,3510 ----
  100.       {
  101.           add_pathsep(buf);
  102.           STRCAT(buf, file);
  103. !         if (ExpandFromContext(&xpc, buf, &num_p, &p, WILD_SILENT) != FAIL
  104. !                                  && num_p > 0)
  105.           {
  106. !         ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT);
  107. !         for (len = 0, i = 0; i < num_p; ++i)
  108. !             len += (long_u)STRLEN(p[i]) + 1;
  109. !         /* Concatenate new results to previous ones. */
  110. !         if (ga_grow(&ga, len) == OK)
  111.           {
  112. !             cur = (char_u *)ga.ga_data + ga.ga_len;
  113. !             for (i = 0; i < num_p; ++i)
  114.               {
  115. !             STRCPY(cur, p[i]);
  116. !             cur += STRLEN(p[i]);
  117. !             *cur++ = '\n';
  118.               }
  119. !             ga.ga_len += len;
  120. !             ga.ga_room -= len;
  121.           }
  122.           }
  123.       }
  124.       }
  125. !     if (cur != NULL)
  126. !     *--cur = 0; /* Replace trailing newline with NUL */
  127.   
  128. !     vim_free(buf);
  129. !     return (char_u *)ga.ga_data;
  130.   }
  131.   
  132.   #endif
  133. *** ../vim61.347/src/version.c    Thu Feb 20 21:40:42 2003
  134. --- src/version.c    Thu Feb 20 21:42:35 2003
  135. ***************
  136. *** 608,609 ****
  137. --- 612,615 ----
  138.   {   /* Add new patch number below this line */
  139. + /**/
  140. +     348,
  141.   /**/
  142.  
  143. -- 
  144. Q: How does a UNIX Guru do Sex ?
  145. A: unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep
  146.  
  147.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  148. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  149. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  150.  \\\     Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
  151.