]>
Commit | Line | Data |
---|---|---|
e8109047 | 1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.283 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.3.283 | |
11 | Problem: An expression mapping with a multi-byte character containing a | |
12 | 0x80 byte gets messed up. (ZyX) | |
13 | Solution: Unescape the expression before evaluating it (Yukihiro Nakadaira) | |
14 | Files: src/getchar.c | |
15 | ||
16 | ||
17 | *** ../vim-7.3.282/src/getchar.c 2011-04-28 17:30:05.000000000 +0200 | |
18 | --- src/getchar.c 2011-08-17 17:04:38.000000000 +0200 | |
19 | *************** | |
20 | *** 3262,3270 **** | |
21 | validate_maphash(); | |
22 | ||
23 | /* | |
24 | ! * find end of keys and skip CTRL-Vs (and backslashes) in it | |
25 | * Accept backslash like CTRL-V when 'cpoptions' does not contain 'B'. | |
26 | ! * with :unmap white space is included in the keys, no argument possible | |
27 | */ | |
28 | p = keys; | |
29 | do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL); | |
30 | --- 3262,3270 ---- | |
31 | validate_maphash(); | |
32 | ||
33 | /* | |
34 | ! * Find end of keys and skip CTRL-Vs (and backslashes) in it. | |
35 | * Accept backslash like CTRL-V when 'cpoptions' does not contain 'B'. | |
36 | ! * with :unmap white space is included in the keys, no argument possible. | |
37 | */ | |
38 | p = keys; | |
39 | do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL); | |
40 | *************** | |
41 | *** 4506,4517 **** | |
42 | --- 4506,4528 ---- | |
43 | { | |
44 | char_u *res; | |
45 | char_u *p; | |
46 | + char_u *expr; | |
47 | char_u *save_cmd; | |
48 | pos_T save_cursor; | |
49 | ||
50 | + /* Remove escaping of CSI, because "str" is in a format to be used as | |
51 | + * typeahead. */ | |
52 | + expr = vim_strsave(str); | |
53 | + if (expr == NULL) | |
54 | + return NULL; | |
55 | + vim_unescape_csi(expr); | |
56 | + | |
57 | save_cmd = save_cmdline_alloc(); | |
58 | if (save_cmd == NULL) | |
59 | + { | |
60 | + vim_free(expr); | |
61 | return NULL; | |
62 | + } | |
63 | ||
64 | /* Forbid changing text or using ":normal" to avoid most of the bad side | |
65 | * effects. Also restore the cursor position. */ | |
66 | *************** | |
67 | *** 4521,4527 **** | |
68 | #endif | |
69 | set_vim_var_char(c); /* set v:char to the typed character */ | |
70 | save_cursor = curwin->w_cursor; | |
71 | ! p = eval_to_string(str, NULL, FALSE); | |
72 | --textlock; | |
73 | #ifdef FEAT_EX_EXTRA | |
74 | --ex_normal_lock; | |
75 | --- 4532,4538 ---- | |
76 | #endif | |
77 | set_vim_var_char(c); /* set v:char to the typed character */ | |
78 | save_cursor = curwin->w_cursor; | |
79 | ! p = eval_to_string(expr, NULL, FALSE); | |
80 | --textlock; | |
81 | #ifdef FEAT_EX_EXTRA | |
82 | --ex_normal_lock; | |
83 | *************** | |
84 | *** 4529,4536 **** | |
85 | --- 4540,4550 ---- | |
86 | curwin->w_cursor = save_cursor; | |
87 | ||
88 | restore_cmdline_alloc(save_cmd); | |
89 | + vim_free(expr); | |
90 | + | |
91 | if (p == NULL) | |
92 | return NULL; | |
93 | + /* Escape CSI in the result to be able to use the string as typeahead. */ | |
94 | res = vim_strsave_escape_csi(p); | |
95 | vim_free(p); | |
96 | ||
97 | *** ../vim-7.3.282/src/version.c 2011-08-17 16:25:43.000000000 +0200 | |
98 | --- src/version.c 2011-08-17 17:17:03.000000000 +0200 | |
99 | *************** | |
100 | *** 711,712 **** | |
101 | --- 711,714 ---- | |
102 | { /* Add new patch number below this line */ | |
103 | + /**/ | |
104 | + 283, | |
105 | /**/ | |
106 | ||
107 | -- | |
108 | bashian roulette: | |
109 | $ ((RANDOM%6)) || rm -rf ~ | |
110 | ||
111 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
112 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
113 | \\\ an exciting new programming language -- http://www.Zimbu.org /// | |
114 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |