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.0.114 < prev    next >
Encoding:
Internet Message Format  |  2001-12-31  |  2.1 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.114
  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.0.114
  11. Problem:    Using ":p" with fnamemodify() didn't expand "~/" or "~user/" to a
  12.         full path.  For Win32 the current directory was prepended.
  13.         (Michael Geddes)
  14. Solution:   Expand the home directory.
  15. Files:        src/eval.c
  16.  
  17.  
  18. *** ../vim60.113/src/eval.c    Mon Dec 31 16:39:26 2001
  19. --- src/eval.c    Tue Jan  1 15:09:37 2002
  20. ***************
  21. *** 8564,8571 ****
  22.       {
  23.       valid |= VALID_PATH;
  24.       *usedlen += 2;
  25.       /* FullName_save() is slow, don't use it when not needed. */
  26. !     if (!vim_isAbsName(*fnamep))
  27.       {
  28.           *fnamep = FullName_save(*fnamep, FALSE);
  29.           vim_free(*bufp);    /* free any allocated file name */
  30. --- 8564,8590 ----
  31.       {
  32.       valid |= VALID_PATH;
  33.       *usedlen += 2;
  34. +     /* Expand "~/path" for all systems and "~user/path" for Unix and VMS */
  35. +     if ((*fnamep)[0] == '~'
  36. + #if !defined(UNIX) && !(defined(VMS) && defined(USER_HOME))
  37. +         && ((*fnamep)[1] == '/'
  38. + # ifdef BACKSLASH_IN_FILENAME
  39. +             || (*fnamep)[1] == '\\'
  40. + # endif
  41. +             || (*fnamep)[1] == NUL)
  42. + #endif
  43. +        )
  44. +     {
  45. +         *fnamep = expand_env_save(*fnamep);
  46. +         vim_free(*bufp);    /* free any allocated file name */
  47. +         *bufp = *fnamep;
  48. +         if (*fnamep == NULL)
  49. +         return -1;
  50. +     }
  51.       /* FullName_save() is slow, don't use it when not needed. */
  52. !     else if (!vim_isAbsName(*fnamep))
  53.       {
  54.           *fnamep = FullName_save(*fnamep, FALSE);
  55.           vim_free(*bufp);    /* free any allocated file name */
  56. *** ../vim60.113/src/version.c    Mon Dec 31 17:47:49 2001
  57. --- src/version.c    Tue Jan  1 15:14:01 2002
  58. ***************
  59. *** 608,609 ****
  60. --- 608,611 ----
  61.   {   /* Add new patch number below this line */
  62. + /**/
  63. +     114,
  64.   /**/
  65.  
  66. -- 
  67. Microsoft's definition of a boolean: TRUE, FALSE, MAYBE
  68. "Embrace and extend"...?
  69.  
  70.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  71. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  72.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  73.