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.042 < prev    next >
Encoding:
Internet Message Format  |  2001-10-29  |  2.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.042
  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.042
  11. Problem:    ":mksession" can't handle file names with a space.
  12. Solution:   Escape special characters in file names with a backslash.
  13. Files:        src/ex_docmd.c
  14.  
  15.  
  16. *** ../vim60.41/src/ex_docmd.c    Sun Oct 28 21:23:45 2001
  17. --- src/ex_docmd.c    Tue Oct 30 21:16:12 2001
  18. ***************
  19. *** 8417,8423 ****
  20.   
  21.   /*
  22.    * Write a file name to the session file.
  23. !  * Takes care of the "slash" option in 'sessionoptions'.
  24.    * Returns FAIL if writing fails.
  25.    */
  26.       static int
  27. --- 8417,8424 ----
  28.   
  29.   /*
  30.    * Write a file name to the session file.
  31. !  * Takes care of the "slash" option in 'sessionoptions' and escapes special
  32. !  * characters.
  33.    * Returns FAIL if writing fails.
  34.    */
  35.       static int
  36. ***************
  37. *** 8433,8451 ****
  38.       sname = home_replace_save(NULL, name);
  39.       if (sname != NULL)
  40.       name = sname;
  41. !     if (*flagp & SSOP_SLASH)
  42.       {
  43. !     while (*name)
  44.       {
  45. !         c = *name++;
  46. !         if (c == '\\')
  47. !         c = '/';
  48. !         if (putc(c, fd) != c)
  49.           retval = FAIL;
  50.       }
  51.       }
  52. -     else if (fputs((char *)name, fd) < 0)
  53. -     retval = FAIL;
  54.       vim_free(sname);
  55.       return retval;
  56.   }
  57. --- 8434,8475 ----
  58.       sname = home_replace_save(NULL, name);
  59.       if (sname != NULL)
  60.       name = sname;
  61. !     while (*name != NUL)
  62.       {
  63. ! #ifdef FEAT_MBYTE
  64.       {
  65. !         int l;
  66. !         if (has_mbyte && (l = (*mb_ptr2len_check)(name)) > 1)
  67. !         {
  68. !         /* copy a multibyte char */
  69. !         while (--l >= 0)
  70. !         {
  71. !             if (putc(*name, fd) != *name)
  72. !             retval = FAIL;
  73. !             ++name;
  74. !         }
  75. !         continue;
  76. !         }
  77. !     }
  78. ! #endif
  79. !     c = *name++;
  80. !     if (c == '\\' && (*flagp & SSOP_SLASH))
  81. !         /* change a backslash to a forward slash */
  82. !         c = '/';
  83. !     else if (vim_strchr(escape_chars, c) != NULL
  84. ! #ifdef BACKSLASH_IN_FILENAME
  85. !         && c != '\\'
  86. ! #endif
  87. !         )
  88. !     {
  89. !         /* escape a special character with a backslash */
  90. !         if (putc('\\', fd) != '\\')
  91.           retval = FAIL;
  92.       }
  93. +     if (putc(c, fd) != c)
  94. +         retval = FAIL;
  95.       }
  96.       vim_free(sname);
  97.       return retval;
  98.   }
  99. *** ../vim60.41/src/version.c    Tue Oct 30 20:43:43 2001
  100. --- src/version.c    Tue Oct 30 20:59:56 2001
  101. ***************
  102. *** 608,609 ****
  103. --- 608,611 ----
  104.   {   /* Add new patch number below this line */
  105. + /**/
  106. +     42,
  107.   /**/
  108.  
  109. -- 
  110. ARTHUR:  No, hang on!  Just answer the five questions ...
  111. GALAHAD: Three questions ...
  112. ARTHUR:  Three questions ...  And we shall watch ... and pray.
  113.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  114.  
  115.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  116. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  117.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  118.