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 / unreleased / patches / old / 5.4o.2 < prev    next >
Encoding:
Internet Message Format  |  1999-07-12  |  2.8 KB

  1. To: "Graham, Scott" <Sgraham@ea.com>
  2. In-Reply-To: <C7A217699E9ED2118D7A0008C7B115C9687B62@eac-exch3.eac.ea.com>
  3. Cc: vim-dev@vim.org
  4. Subject: patch 5.4o.2 (was: vim54n - 'gf' causes IPF)
  5. From: Bram Moolenaar <Bram@moolenaar.net>
  6. Date: Tue, 13 Jul 1999 10:32:45 +0200
  7. Sender: mool@masaka.moolenaar.net
  8.  
  9.  
  10. Scott Graham wrote:
  11. > Doing 'gf' on top of file.c in the following line:
  12. > file.c://comment here
  13. > causes an IPF (it was grep output). It seems to be related to the ':'
  14. > specifically, but I haven't narrowed it down any further.
  15.  
  16. Indeed.  It is easy to reproduce.
  17.  
  18. > - output of bugreport.vim follows (sorry it's so large, wasn't sure if you'd
  19. >   want any or all of it):
  20.  
  21. Didn't need it in this case.  It often helps to find specific info, although
  22. it is indeed a bit large and it can be difficult to find the item that
  23. matters.  If you can reproduce the problem with "vim -u NONE" I mostly don't
  24. need the bugreport.
  25.  
  26.  
  27. Patch 5.4o.2
  28. Problem:    Crash when using "gf" on "file.c://comment here". (Scott Graham)
  29. Solution:   Fix wrong use of pointers in get_file_name_in_path().
  30. Files:        src/window.c
  31.  
  32.  
  33. *** ../vim-5.4o/src/window.c    Sun Jul 11 20:10:36 1999
  34. --- src/window.c    Tue Jul 13 10:24:22 1999
  35. ***************
  36. *** 1852,1857 ****
  37. --- 1852,1858 ----
  38.   {
  39.       char_u  *ptr;
  40.       char_u  *file_name;
  41. +     char_u  *path;
  42.       int        len;
  43.   
  44.       /*
  45. ***************
  46. *** 1894,1908 ****
  47.        * Such a link looks like "type://machine/path". Only "/path" is used.
  48.        * First search for the string "://", then for the extra '/'
  49.        */
  50. !     if ((file_name = vim_strchr(ptr, ':')) != NULL &&
  51. !         ((path_is_url(file_name) == URL_SLASH &&
  52. !           (file_name = vim_strchr(file_name + 3, '/')) != NULL) ||
  53. !          (path_is_url(file_name) == URL_BACKSLASH &&
  54. !           (file_name = vim_strchr(file_name + 3, '\\')) != NULL)) &&
  55. !         file_name < ptr + len)
  56.       {
  57. !         len -= file_name - ptr;
  58. !         ptr = file_name;
  59.           if (ptr[1] == '~')        /* skip '/' for /~user/path */
  60.           {
  61.           ++ptr;
  62. --- 1895,1909 ----
  63.        * Such a link looks like "type://machine/path". Only "/path" is used.
  64.        * First search for the string "://", then for the extra '/'
  65.        */
  66. !     if ((file_name = vim_strchr(ptr, ':')) != NULL
  67. !         && ((path_is_url(file_name) == URL_SLASH
  68. !             && (path = vim_strchr(file_name + 3, '/')) != NULL)
  69. !             || (path_is_url(file_name) == URL_BACKSLASH
  70. !             && (path = vim_strchr(file_name + 3, '\\')) != NULL))
  71. !         && path < ptr + len)
  72.       {
  73. !         len -= path - ptr;
  74. !         ptr = path;
  75.           if (ptr[1] == '~')        /* skip '/' for /~user/path */
  76.           {
  77.           ++ptr;
  78.  
  79. --
  80. hundred-and-one symptoms of being an internet addict:
  81. 66. You create a homepage with the impression to cure the afflicted...but
  82.     your hidden agenda is to receive more e-mail.
  83.  
  84. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  85.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  86.