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.6.095 < prev    next >
Encoding:
Internet Message Format  |  2000-06-07  |  2.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 5.6.095
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.6.095
  8. Problem:    With an Emacs TAGS file that include another a relative path
  9.         doesn't always work.
  10. Solution:   Use expand_tag_fname() on the name of the included file.
  11.         (Utz-Uwe Haus)
  12. Files:        src/tag.c
  13.  
  14.  
  15. *** ../vim-5.6.94/src/tag.c    Mon Jun  5 11:24:35 2000
  16. --- src/tag.c    Thu Jun  8 20:56:56 2000
  17. ***************
  18. *** 1206,1226 ****
  19.               if (STRNCMP(p + 1, "include", 7) == 0
  20.                             && incstack_idx < INCSTACK_SIZE)
  21.               {
  22.               if ((incstack[incstack_idx].etag_fname =
  23.                             vim_strsave(tag_fname)) != NULL)
  24.               {
  25.                   incstack[incstack_idx].fp = fp;
  26. !                 if ((fp = mch_fopen((char *)ebuf, "r")) == NULL)
  27.                   {
  28. !                 fp = incstack[incstack_idx].fp;
  29. !                 vim_free(incstack[incstack_idx].etag_fname);
  30.                   }
  31. !                 else
  32.                   {
  33. !                 STRCPY(tag_fname, ebuf);
  34. !                 ++incstack_idx;
  35.                   }
  36. -                 is_etag = 0;    /* we can include anything */
  37.               }
  38.               }
  39.           }
  40. --- 1205,1244 ----
  41.               if (STRNCMP(p + 1, "include", 7) == 0
  42.                             && incstack_idx < INCSTACK_SIZE)
  43.               {
  44. +             /* Save current "fp" and "tag_fname" in the stack. */
  45.               if ((incstack[incstack_idx].etag_fname =
  46.                             vim_strsave(tag_fname)) != NULL)
  47.               {
  48. +                 char_u *fullpath_ebuf;
  49.                   incstack[incstack_idx].fp = fp;
  50. !                 fp = NULL;
  51. !                 /* Figure out "tag_fname" and "fp" to use for
  52. !                  * included file. */
  53. !                 fullpath_ebuf = expand_tag_fname(ebuf,
  54. !                                 tag_fname, FALSE);
  55. !                 if (fullpath_ebuf != NULL)
  56.                   {
  57. !                 fp = mch_fopen((char *)fullpath_ebuf, "r");
  58. !                 if (fp != NULL)
  59. !                 {
  60. !                     if (STRLEN(fullpath_ebuf) > LSIZE)
  61. !                       EMSG2("Tag file path trucated for %s\n", ebuf);
  62. !                     STRNCPY(tag_fname, fullpath_ebuf, LSIZE);
  63. !                     tag_fname[LSIZE] = NUL;
  64. !                     ++incstack_idx;
  65. !                     is_etag = 0; /* we can include anything */
  66. !                 }
  67. !                 vim_free(fullpath_ebuf);
  68.                   }
  69. !                 if (fp == NULL)
  70.                   {
  71. !                 /* Can't open the included file, skip it and
  72. !                  * restore old value of "fp". */
  73. !                 fp = incstack[incstack_idx].fp;
  74. !                 vim_free(incstack[incstack_idx].etag_fname);
  75.                   }
  76.               }
  77.               }
  78.           }
  79. *** ../vim-5.6.94/src/version.c    Wed Jun  7 14:04:31 2000
  80. --- src/version.c    Thu Jun  8 20:53:00 2000
  81. ***************
  82. *** 420,421 ****
  83. --- 420,423 ----
  84.   {   /* Add new patch number below this line */
  85. + /**/
  86. +     95,
  87.   /**/
  88.  
  89. -- 
  90. Female engineers become irresistible at the age of consent and remain that
  91. way until about thirty minutes after their clinical death.  Longer if it's a
  92. warm day.
  93.                 (Scott Adams - The Dilbert principle)
  94.  
  95. /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\
  96. \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/
  97.