]>
Commit | Line | Data |
---|---|---|
ef75664d AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.1.266 | |
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.1.266 | |
11 | Problem: When the version string returned by the terminal contains | |
12 | unexpected characters, it is used as typed input. (James Vega) | |
13 | Solution: Assume the escape sequence ends in a letter. | |
14 | Files: src/term.c | |
15 | ||
16 | ||
17 | *** ../vim-7.1.265/src/term.c Sat Sep 15 14:06:41 2007 | |
18 | --- src/term.c Mon Feb 25 20:21:53 2008 | |
19 | *************** | |
20 | *** 4050,4064 **** | |
21 | { | |
22 | /* Check for xterm version string: "<Esc>[>{x};{vers};{y}c". Also | |
23 | * eat other possible responses to t_RV, rxvt returns | |
24 | ! * "<Esc>[?1;2c". Also accept CSI instead of <Esc>[. */ | |
25 | if (*T_CRV != NUL && ((tp[0] == ESC && tp[1] == '[' && len >= 3) | |
26 | || (tp[0] == CSI && len >= 2))) | |
27 | { | |
28 | j = 0; | |
29 | extra = 0; | |
30 | ! for (i = 2 + (tp[0] != CSI); | |
31 | ! i < len && (VIM_ISDIGIT(tp[i]) | |
32 | ! || tp[i] == ';' || tp[i] == '.'); ++i) | |
33 | if (tp[i] == ';' && ++j == 1) | |
34 | extra = atoi((char *)tp + i + 1); | |
35 | if (i == len) | |
36 | --- 4050,4066 ---- | |
37 | { | |
38 | /* Check for xterm version string: "<Esc>[>{x};{vers};{y}c". Also | |
39 | * eat other possible responses to t_RV, rxvt returns | |
40 | ! * "<Esc>[?1;2c". Also accept CSI instead of <Esc>[. | |
41 | ! * mrxvt has been reported to have "+" in the version. Assume | |
42 | ! * the escape sequence ends with a letter or one of "{|}~". */ | |
43 | if (*T_CRV != NUL && ((tp[0] == ESC && tp[1] == '[' && len >= 3) | |
44 | || (tp[0] == CSI && len >= 2))) | |
45 | { | |
46 | j = 0; | |
47 | extra = 0; | |
48 | ! for (i = 2 + (tp[0] != CSI); i < len | |
49 | ! && !(tp[i] >= '{' && tp[i] <= '~') | |
50 | ! && !ASCII_ISALPHA(tp[i]); ++i) | |
51 | if (tp[i] == ';' && ++j == 1) | |
52 | extra = atoi((char *)tp + i + 1); | |
53 | if (i == len) | |
54 | *** ../vim-7.1.265/src/version.c Tue Feb 26 21:29:06 2008 | |
55 | --- src/version.c Wed Feb 27 16:10:59 2008 | |
56 | *************** | |
57 | *** 668,669 **** | |
58 | --- 668,671 ---- | |
59 | { /* Add new patch number below this line */ | |
60 | + /**/ | |
61 | + 266, | |
62 | /**/ | |
63 | ||
64 | -- | |
65 | hundred-and-one symptoms of being an internet addict: | |
66 | 54. You start tilting your head sideways to smile. :-) | |
67 | ||
68 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
69 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
70 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
71 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |