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.213 < prev    next >
Encoding:
Internet Message Format  |  2002-02-10  |  2.9 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.213
  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.213
  11. Problem:    When a file name contains unprintable characters, CTRL-G and other
  12.         commands don't work well.
  13. Solution:   Turn unprintable into printable characters. (Yasuhiro Matsumoto)
  14. Files:        src/buffer.c, src/charset.c
  15.  
  16.  
  17. *** ../vim60.212/src/buffer.c    Tue Jan 22 14:22:37 2002
  18. --- src/buffer.c    Fri Feb  8 11:34:32 2002
  19. ***************
  20. *** 2490,2495 ****
  21. --- 2490,2498 ----
  22.           name = curbuf->b_ffname;
  23.       home_replace(shorthelp ? curbuf : NULL, name, p,
  24.                         (int)(IOSIZE - (p - buffer)), TRUE);
  25. +     /* the file name may contain unprintable characters, esp. when using
  26. +      * multi-byte chars */
  27. +     trans_characters(buffer, IOSIZE);
  28.       }
  29.   
  30.       sprintf((char *)buffer + STRLEN(buffer),
  31. *** ../vim60.212/src/charset.c    Fri Jan 25 10:05:09 2002
  32. --- src/charset.c    Sun Feb 10 13:20:31 2002
  33. ***************
  34. *** 274,280 ****
  35.       return OK;
  36.   }
  37.   
  38. - #if defined(FEAT_STL_OPT) || defined(FEAT_WINDOWS) || defined(PROTO)
  39.   /*
  40.    * Translate any special characters in buf[bufsize] in-place.
  41.    * If there is not enough room, not all characters will be translated.
  42. --- 274,279 ----
  43. ***************
  44. *** 294,306 ****
  45.       while (*buf != 0)
  46.       {
  47.   #ifdef FEAT_MBYTE
  48.       /* Assume a multi-byte character doesn't need translation. */
  49.       if (has_mbyte && (trs_len = (*mb_ptr2len_check)(buf)) > 1)
  50.           len -= trs_len;
  51.       else
  52.   #endif
  53.       {
  54. !         trs = transchar(*buf);
  55.           trs_len = (int)STRLEN(trs);
  56.           if (trs_len > 1)
  57.           {
  58. --- 293,316 ----
  59.       while (*buf != 0)
  60.       {
  61.   #ifdef FEAT_MBYTE
  62. +     char    bstr[7];
  63.       /* Assume a multi-byte character doesn't need translation. */
  64.       if (has_mbyte && (trs_len = (*mb_ptr2len_check)(buf)) > 1)
  65.           len -= trs_len;
  66.       else
  67.   #endif
  68.       {
  69. ! #ifdef FEAT_MBYTE
  70. !         /* catch illegal UTF-8 byte */
  71. !         if (enc_utf8 && *buf >= 0x80)
  72. !         {
  73. !         transchar_nonprint(bstr, *buf);
  74. !         trs = bstr;
  75. !         }
  76. !         else
  77. ! #endif
  78. !         trs = transchar(*buf);
  79.           trs_len = (int)STRLEN(trs);
  80.           if (trs_len > 1)
  81.           {
  82. ***************
  83. *** 315,321 ****
  84.       buf += trs_len;
  85.       }
  86.   }
  87. - #endif
  88.   
  89.   #if defined(FEAT_EVAL) || defined(FEAT_TITLE) || defined(PROTO)
  90.   /*
  91. --- 325,330 ----
  92. *** ../vim60.212/src/version.c    Mon Feb 11 14:04:44 2002
  93. --- src/version.c    Mon Feb 11 14:07:40 2002
  94. ***************
  95. *** 608,609 ****
  96. --- 608,611 ----
  97.   {   /* Add new patch number below this line */
  98. + /**/
  99. +     213,
  100.   /**/
  101.  
  102. -- 
  103. A computer programmer is a device for turning requirements into
  104. undocumented features.  It runs on cola, pizza and Dilbert cartoons.
  105.                     Bram Moolenaar
  106.  
  107.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  108. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  109.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  110.