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.074 < prev    next >
Encoding:
Internet Message Format  |  2002-05-15  |  7.9 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.074
  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.074
  11. Problem:    When 'cdpath' includes "../..", changing to a directory in which
  12.         we currently already are doesn't work.  ff_check_visited() adds
  13.         the directory both when using it as the root for searching and for
  14.         the actual matches. (Stephen Rasku)
  15. Solution:   Use a separate list for the already searched directories.
  16. Files:        src/misc2.c
  17.  
  18.  
  19. *** ../vim61.073/src/misc2.c    Sun May  5 22:51:14 2002
  20. --- src/misc2.c    Sun May  5 21:48:59 2002
  21. ***************
  22. *** 3318,3324 ****
  23.   
  24.   /*
  25.    * We might have to manage several visited lists during a search.
  26. !  * This is expecially needed for * the tags option. If tags is set to:
  27.    *      "./++/tags,./++/TAGS,++/tags"  (replace + with *)
  28.    * So we have to do 3 searches:
  29.    *   1) search from the current files directory downward for the file "tags"
  30. --- 3318,3324 ----
  31.   
  32.   /*
  33.    * We might have to manage several visited lists during a search.
  34. !  * This is expecially needed for the tags option. If tags is set to:
  35.    *      "./++/tags,./++/TAGS,++/tags"  (replace + with *)
  36.    * So we have to do 3 searches:
  37.    *   1) search from the current files directory downward for the file "tags"
  38. ***************
  39. *** 3351,3357 ****
  40. --- 3351,3359 ----
  41.    * The search context:
  42.    *   ffsc_stack_ptr:    the stack for the dirs to search
  43.    *   ffsc_visited_list: the currently active visited list
  44. +  *   ffsc_dir_visited_list: the currently active visited list for search dirs
  45.    *   ffsc_visited_lists_list: the list of all visited lists
  46. +  *   ffsc_dir_visited_lists_list: the list of all visited lists for search dirs
  47.    *   ffsc_file_to_search:     the file to search for
  48.    *   ffsc_start_dir:    the starting directory, if search path was relative
  49.    *   ffsc_fix_path:    the fix part of the given path (without wildcards)
  50. ***************
  51. *** 3365,3371 ****
  52. --- 3367,3375 ----
  53.   {
  54.        ff_stack_T            *ffsc_stack_ptr;
  55.        ff_visited_list_hdr_T    *ffsc_visited_list;
  56. +      ff_visited_list_hdr_T    *ffsc_dir_visited_list;
  57.        ff_visited_list_hdr_T    *ffsc_visited_lists_list;
  58. +      ff_visited_list_hdr_T    *ffsc_dir_visited_lists_list;
  59.        char_u            *ffsc_file_to_search;
  60.        char_u            *ffsc_start_dir;
  61.        char_u            *ffsc_fix_path;
  62. ***************
  63. *** 3387,3394 ****
  64.   #else
  65.   static int ff_check_visited __ARGS((ff_visited_T **, char_u *));
  66.   #endif
  67.   static void ff_free_visited_list __ARGS((ff_visited_T *vl));
  68. ! static ff_visited_list_hdr_T* ff_get_visited_list __ARGS((char_u *));
  69.   #ifdef FEAT_PATH_EXTRA
  70.   static int ff_wc_equal __ARGS((char_u *s1, char_u *s2));
  71.   #endif
  72. --- 3391,3399 ----
  73.   #else
  74.   static int ff_check_visited __ARGS((ff_visited_T **, char_u *));
  75.   #endif
  76. + static void vim_findfile_free_visited_list __ARGS((ff_visited_list_hdr_T **list_headp));
  77.   static void ff_free_visited_list __ARGS((ff_visited_T *vl));
  78. ! static ff_visited_list_hdr_T* ff_get_visited_list __ARGS((char_u *, ff_visited_list_hdr_T **list_headp));
  79.   #ifdef FEAT_PATH_EXTRA
  80.   static int ff_wc_equal __ARGS((char_u *s1, char_u *s2));
  81.   #endif
  82. ***************
  83. *** 3541,3549 ****
  84.        * filename. If no list for the current filename exists, creates a new
  85.        * one.
  86.        */
  87. !     ff_search_ctx->ffsc_visited_list = ff_get_visited_list(filename);
  88.       if (ff_search_ctx->ffsc_visited_list == NULL)
  89.           goto error_return;
  90.       }
  91.   
  92.       if (ff_expand_buffer == NULL)
  93. --- 3546,3559 ----
  94.        * filename. If no list for the current filename exists, creates a new
  95.        * one.
  96.        */
  97. !     ff_search_ctx->ffsc_visited_list = ff_get_visited_list(filename,
  98. !                      &ff_search_ctx->ffsc_visited_lists_list);
  99.       if (ff_search_ctx->ffsc_visited_list == NULL)
  100.           goto error_return;
  101. +     ff_search_ctx->ffsc_dir_visited_list = ff_get_visited_list(filename,
  102. +                  &ff_search_ctx->ffsc_dir_visited_lists_list);
  103. +     if (ff_search_ctx->ffsc_dir_visited_list == NULL)
  104. +         goto error_return;
  105.       }
  106.   
  107.       if (ff_expand_buffer == NULL)
  108. ***************
  109. *** 3915,3921 ****
  110.            * first time (hence ctx->ff_filearray == NULL)
  111.            */
  112.           if (ctx->ffs_filearray == NULL
  113. !             && ff_check_visited(&ff_search_ctx->ffsc_visited_list
  114.                                 ->ffvl_visited_list,
  115.               ctx->ffs_fix_path
  116.   #ifdef FEAT_PATH_EXTRA
  117. --- 3925,3931 ----
  118.            * first time (hence ctx->ff_filearray == NULL)
  119.            */
  120.           if (ctx->ffs_filearray == NULL
  121. !             && ff_check_visited(&ff_search_ctx->ffsc_dir_visited_list
  122.                                 ->ffvl_visited_list,
  123.               ctx->ffs_fix_path
  124.   #ifdef FEAT_PATH_EXTRA
  125. ***************
  126. *** 4282,4305 ****
  127.   vim_findfile_free_visited(search_ctx)
  128.       void    *search_ctx;
  129.   {
  130. !     ff_visited_list_hdr_T *vp;
  131. !     if (NULL == search_ctx)
  132.       return;
  133.   
  134. !     ff_search_ctx = (ff_search_ctx_T*)search_ctx;
  135.   
  136. !     while (NULL != ff_search_ctx->ffsc_visited_lists_list)
  137.       {
  138. !     vp = ff_search_ctx->ffsc_visited_lists_list->ffvl_next;
  139. !     ff_free_visited_list(
  140. !         ff_search_ctx->ffsc_visited_lists_list->ffvl_visited_list);
  141. !     vim_free(ff_search_ctx->ffsc_visited_lists_list->ffvl_filename);
  142. !     vim_free(ff_search_ctx->ffsc_visited_lists_list);
  143. !     ff_search_ctx->ffsc_visited_lists_list = vp;
  144.       }
  145. !     ff_search_ctx->ffsc_visited_lists_list = NULL;
  146.   }
  147.   
  148.       static void
  149. --- 4292,4322 ----
  150.   vim_findfile_free_visited(search_ctx)
  151.       void    *search_ctx;
  152.   {
  153. !     if (search_ctx == NULL)
  154.       return;
  155.   
  156. !     ff_search_ctx = (ff_search_ctx_T *)search_ctx;
  157. !     vim_findfile_free_visited_list(&ff_search_ctx->ffsc_visited_lists_list);
  158. !     vim_findfile_free_visited_list(&ff_search_ctx->ffsc_dir_visited_lists_list);
  159. ! }
  160.   
  161. !     static void
  162. ! vim_findfile_free_visited_list(list_headp)
  163. !     ff_visited_list_hdr_T    **list_headp;
  164. ! {
  165. !     ff_visited_list_hdr_T *vp;
  166. !     while (*list_headp != NULL)
  167.       {
  168. !     vp = (*list_headp)->ffvl_next;
  169. !     ff_free_visited_list((*list_headp)->ffvl_visited_list);
  170. !     vim_free((*list_headp)->ffvl_filename);
  171. !     vim_free(*list_headp);
  172. !     *list_headp = vp;
  173.       }
  174. !     *list_headp = NULL;
  175.   }
  176.   
  177.       static void
  178. ***************
  179. *** 4322,4336 ****
  180.    * allocates a new one.
  181.    */
  182.       static ff_visited_list_hdr_T*
  183. ! ff_get_visited_list(filename)
  184. !     char_u    *filename;
  185.   {
  186.       ff_visited_list_hdr_T  *retptr = NULL;
  187.   
  188.       /* check if a visited list for the given filename exists */
  189. !     if (ff_search_ctx->ffsc_visited_lists_list!= NULL)
  190.       {
  191. !     retptr = ff_search_ctx->ffsc_visited_lists_list;
  192.       while (retptr != NULL)
  193.       {
  194.           if (fnamecmp(filename, retptr->ffvl_filename) == 0)
  195. --- 4339,4354 ----
  196.    * allocates a new one.
  197.    */
  198.       static ff_visited_list_hdr_T*
  199. ! ff_get_visited_list(filename, list_headp)
  200. !     char_u            *filename;
  201. !     ff_visited_list_hdr_T    **list_headp;
  202.   {
  203.       ff_visited_list_hdr_T  *retptr = NULL;
  204.   
  205.       /* check if a visited list for the given filename exists */
  206. !     if (*list_headp != NULL)
  207.       {
  208. !     retptr = *list_headp;
  209.       while (retptr != NULL)
  210.       {
  211.           if (fnamecmp(filename, retptr->ffvl_filename) == 0)
  212. ***************
  213. *** 4380,4387 ****
  214.       vim_free(retptr);
  215.       return NULL;
  216.       }
  217. !     retptr->ffvl_next = ff_search_ctx->ffsc_visited_lists_list;
  218. !     ff_search_ctx->ffsc_visited_lists_list = retptr;
  219.   
  220.       return retptr;
  221.   }
  222. --- 4398,4405 ----
  223.       vim_free(retptr);
  224.       return NULL;
  225.       }
  226. !     retptr->ffvl_next = *list_headp;
  227. !     *list_headp = retptr;
  228.   
  229.       return retptr;
  230.   }
  231. *** ../vim61.073/src/version.c    Thu May 16 22:08:09 2002
  232. --- src/version.c    Thu May 16 22:10:38 2002
  233. ***************
  234. *** 608,609 ****
  235. --- 608,611 ----
  236.   {   /* Add new patch number below this line */
  237. + /**/
  238. +     74,
  239.   /**/
  240.  
  241. -- 
  242. How To Keep A Healthy Level Of Insanity:
  243. 6. In the memo field of all your checks, write "for sexual favors".
  244.  
  245.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  246. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  247. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  248.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  249.