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 / 7.0 / 7.0.203 < prev    next >
Encoding:
Internet Message Format  |  2007-02-26  |  5.4 KB

  1. To: vim-dev@vim.org
  2. Subject: patch 7.0.203
  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 7.0.203
  11. Problem:    0x80 characters in a register are not handled correctly for the
  12.         "@" command.
  13. Solution:   Escape CSI and 0x80 characters. (Yukihiro Nakadaira)
  14. Files:        src/ops.c
  15.  
  16.  
  17. *** ../vim-7.0.202/src/ops.c    Tue Nov  7 18:43:10 2006
  18. --- src/ops.c    Tue Feb 27 17:24:02 2007
  19. ***************
  20. *** 96,102 ****
  21.   #endif
  22.   static int    stuff_yank __ARGS((int, char_u *));
  23.   static void    put_reedit_in_typebuf __ARGS((int silent));
  24. ! static int    put_in_typebuf __ARGS((char_u *s, int colon, int silent));
  25.   static void    stuffescaped __ARGS((char_u *arg, int literally));
  26.   #ifdef FEAT_MBYTE
  27.   static void    mb_adjust_opend __ARGS((oparg_T *oap));
  28. --- 96,103 ----
  29.   #endif
  30.   static int    stuff_yank __ARGS((int, char_u *));
  31.   static void    put_reedit_in_typebuf __ARGS((int silent));
  32. ! static int    put_in_typebuf __ARGS((char_u *s, int esc, int colon,
  33. !                                  int silent));
  34.   static void    stuffescaped __ARGS((char_u *arg, int literally));
  35.   #ifdef FEAT_MBYTE
  36.   static void    mb_adjust_opend __ARGS((oparg_T *oap));
  37. ***************
  38. *** 1174,1182 ****
  39.           /* When in Visual mode "'<,'>" will be prepended to the command.
  40.            * Remove it when it's already there. */
  41.           if (VIsual_active && STRNCMP(p, "'<,'>", 5) == 0)
  42. !         retval = put_in_typebuf(p + 5, TRUE, silent);
  43.           else
  44. !         retval = put_in_typebuf(p, TRUE, silent);
  45.       }
  46.       vim_free(p);
  47.       }
  48. --- 1175,1183 ----
  49.           /* When in Visual mode "'<,'>" will be prepended to the command.
  50.            * Remove it when it's already there. */
  51.           if (VIsual_active && STRNCMP(p, "'<,'>", 5) == 0)
  52. !         retval = put_in_typebuf(p + 5, TRUE, TRUE, silent);
  53.           else
  54. !         retval = put_in_typebuf(p, TRUE, TRUE, silent);
  55.       }
  56.       vim_free(p);
  57.       }
  58. ***************
  59. *** 1187,1193 ****
  60.       p = get_expr_line();
  61.       if (p == NULL)
  62.           return FAIL;
  63. !     retval = put_in_typebuf(p, colon, silent);
  64.       vim_free(p);
  65.       }
  66.   #endif
  67. --- 1188,1194 ----
  68.       p = get_expr_line();
  69.       if (p == NULL)
  70.           return FAIL;
  71. !     retval = put_in_typebuf(p, TRUE, colon, silent);
  72.       vim_free(p);
  73.       }
  74.   #endif
  75. ***************
  76. *** 1199,1205 ****
  77.           EMSG(_(e_noinstext));
  78.           return FAIL;
  79.       }
  80. !     retval = put_in_typebuf(p, colon, silent);
  81.       vim_free(p);
  82.       }
  83.       else
  84. --- 1200,1206 ----
  85.           EMSG(_(e_noinstext));
  86.           return FAIL;
  87.       }
  88. !     retval = put_in_typebuf(p, FALSE, colon, silent);
  89.       vim_free(p);
  90.       }
  91.       else
  92. ***************
  93. *** 1217,1222 ****
  94. --- 1218,1225 ----
  95.       put_reedit_in_typebuf(silent);
  96.       for (i = y_current->y_size; --i >= 0; )
  97.       {
  98. +         char_u *escaped;
  99.           /* insert NL between lines and after last line if type is MLINE */
  100.           if (y_current->y_type == MLINE || i < y_current->y_size - 1
  101.                                        || addcr)
  102. ***************
  103. *** 1224,1231 ****
  104.           if (ins_typebuf((char_u *)"\n", remap, 0, TRUE, silent) == FAIL)
  105.               return FAIL;
  106.           }
  107. !         if (ins_typebuf(y_current->y_array[i], remap, 0, TRUE, silent)
  108. !                                       == FAIL)
  109.           return FAIL;
  110.           if (colon && ins_typebuf((char_u *)":", remap, 0, TRUE, silent)
  111.                                         == FAIL)
  112. --- 1227,1238 ----
  113.           if (ins_typebuf((char_u *)"\n", remap, 0, TRUE, silent) == FAIL)
  114.               return FAIL;
  115.           }
  116. !         escaped = vim_strsave_escape_csi(y_current->y_array[i]);
  117. !         if (escaped == NULL)
  118. !         return FAIL;
  119. !         retval = ins_typebuf(escaped, remap, 0, TRUE, silent);
  120. !         vim_free(escaped);
  121. !         if (retval == FAIL)
  122.           return FAIL;
  123.           if (colon && ins_typebuf((char_u *)":", remap, 0, TRUE, silent)
  124.                                         == FAIL)
  125. ***************
  126. *** 1265,1272 ****
  127.   }
  128.   
  129.       static int
  130. ! put_in_typebuf(s, colon, silent)
  131.       char_u    *s;
  132.       int        colon;        /* add ':' before the line */
  133.       int        silent;
  134.   {
  135. --- 1272,1280 ----
  136.   }
  137.   
  138.       static int
  139. ! put_in_typebuf(s, esc, colon, silent)
  140.       char_u    *s;
  141. +     int        esc;        /* Escape CSI characters */
  142.       int        colon;        /* add ':' before the line */
  143.       int        silent;
  144.   {
  145. ***************
  146. *** 1276,1282 ****
  147.       if (colon)
  148.       retval = ins_typebuf((char_u *)"\n", REMAP_YES, 0, TRUE, silent);
  149.       if (retval == OK)
  150. !     retval = ins_typebuf(s, REMAP_YES, 0, TRUE, silent);
  151.       if (colon && retval == OK)
  152.       retval = ins_typebuf((char_u *)":", REMAP_YES, 0, TRUE, silent);
  153.       return retval;
  154. --- 1284,1303 ----
  155.       if (colon)
  156.       retval = ins_typebuf((char_u *)"\n", REMAP_YES, 0, TRUE, silent);
  157.       if (retval == OK)
  158. !     {
  159. !     char_u    *p;
  160. !     if (esc)
  161. !         p = vim_strsave_escape_csi(s);
  162. !     else
  163. !         p = s;
  164. !     if (p == NULL)
  165. !         retval = FAIL;
  166. !     else
  167. !         retval = ins_typebuf(p, REMAP_YES, 0, TRUE, silent);
  168. !     if (esc)
  169. !         vim_free(p);
  170. !     }
  171.       if (colon && retval == OK)
  172.       retval = ins_typebuf((char_u *)":", REMAP_YES, 0, TRUE, silent);
  173.       return retval;
  174. *** ../vim-7.0.202/src/version.c    Tue Feb 27 16:51:07 2007
  175. --- src/version.c    Tue Feb 27 17:22:13 2007
  176. ***************
  177. *** 668,669 ****
  178. --- 668,671 ----
  179.   {   /* Add new patch number below this line */
  180. + /**/
  181. +     203,
  182.   /**/
  183.  
  184. -- 
  185. hundred-and-one symptoms of being an internet addict:
  186. 215. Your mouse-clicking forearm rivals Popeye's.
  187.  
  188.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  189. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  190. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  191.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  192.