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.241 < prev    next >
Encoding:
Internet Message Format  |  2002-02-19  |  3.4 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.241
  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.241
  11. Problem:    Win32: Expanding the old value of an option that is a path that
  12.         starts with a backslash, an extra backslash is inserted.
  13. Solution:   Only insert backslashes where needed.
  14.         Also handle multi-byte characters properly when removing
  15.         backslashes.
  16. Files:        src/option.c
  17.  
  18.  
  19. *** ../vim60.240/src/option.c    Mon Feb 11 20:37:46 2002
  20. --- src/option.c    Wed Feb 20 22:02:26 2002
  21. ***************
  22. *** 3539,3544 ****
  23. --- 3539,3545 ----
  24.                    * file name characters are not removed, and keep
  25.                    * backslash at start, for "\\machine\path", but
  26.                    * do remove it for "\\\\machine\\path".
  27. +                  * The reverse is found in ExpandOldSetting().
  28.                    */
  29.                   while (*arg && !vim_iswhite(*arg))
  30.                   {
  31. ***************
  32. *** 3551,3558 ****
  33.                               && arg[2] != '\\')))
  34.   #endif
  35.                                       )
  36. !                     ++arg;
  37. !                 *s++ = *arg++;
  38.                   }
  39.                   *s = NUL;
  40.   
  41. --- 3552,3570 ----
  42.                               && arg[2] != '\\')))
  43.   #endif
  44.                                       )
  45. !                     ++arg;    /* remove backslash */
  46. ! #ifdef FEAT_MBYTE
  47. !                 if (has_mbyte
  48. !                     && (i = (*mb_ptr2len_check)(arg)) > 1)
  49. !                 {
  50. !                     /* copy multibyte char */
  51. !                     mch_memmove(s, arg, (size_t)i);
  52. !                     arg += i;
  53. !                     s += i;
  54. !                 }
  55. !                 else
  56. ! #endif
  57. !                     *s++ = *arg++;
  58.                   }
  59.                   *s = NUL;
  60.   
  61. ***************
  62. *** 8002,8008 ****
  63.       else if (var == NULL)
  64.       var = (char_u *)"";
  65.   
  66. !     /* A backslash is required before some characters */
  67.       buf = vim_strsave_escaped(var, escape_chars);
  68.   
  69.       if (buf == NULL)
  70. --- 8013,8020 ----
  71.       else if (var == NULL)
  72.       var = (char_u *)"";
  73.   
  74. !     /* A backslash is required before some characters.  This is the reverse of
  75. !      * what happens in do_set(). */
  76.       buf = vim_strsave_escaped(var, escape_chars);
  77.   
  78.       if (buf == NULL)
  79. ***************
  80. *** 8011,8016 ****
  81. --- 8023,8047 ----
  82.       *file = NULL;
  83.       return FAIL;
  84.       }
  85. + #ifdef BACKSLASH_IN_FILENAME
  86. +     /* For MS-Windows et al. we don't double backslashes at the start and
  87. +      * before a file name character. */
  88. +     for (var = buf; *var != NUL; )
  89. +     {
  90. +     if (var[0] == '\\' && var[1] == '\\'
  91. +         && expand_option_idx >= 0
  92. +         && (options[expand_option_idx].flags & P_EXPAND)
  93. +         && vim_isfilec(var[2])
  94. +         && (var[2] != '\\' || (var == buf && var[4] != '\\')))
  95. +         mch_memmove(var, var + 1, STRLEN(var));
  96. + #ifdef FEAT_MBYTE
  97. +     else if (has_mbyte)
  98. +         var += (*mb_ptr2len_check)(var) - 1;
  99. + #endif
  100. +     ++var;
  101. +     }
  102. + #endif
  103.   
  104.       *file[0] = buf;
  105.       *num_file = 1;
  106. *** ../vim60.240/src/version.c    Wed Feb 20 21:21:02 2002
  107. --- src/version.c    Wed Feb 20 22:05:15 2002
  108. ***************
  109. *** 608,609 ****
  110. --- 608,611 ----
  111.   {   /* Add new patch number below this line */
  112. + /**/
  113. +     241,
  114.   /**/
  115.  
  116. -- 
  117. BEDEVERE: Wait.  Wait ... tell me, what also floats on water?
  118. ALL:      Bread?  No, no, no.  Apples .... gravy ... very small rocks ...
  119. ARTHUR:   A duck.
  120.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  121.  
  122.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  123. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  124. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  125.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  126.