4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Crash when using a modifier before "while" or "for". (A.Politz)
12 Solution: Skip modifiers when checking for a loop command.
13 Files: src/proto/ex_docmd.pro, src/ex_docmd.c, src/ex_eval.c
16 *** ../vim-7.1.161/src/proto/ex_docmd.pro Sun Sep 30 14:00:41 2007
17 --- src/proto/ex_docmd.pro Sat Nov 24 16:34:06 2007
21 int getline_equal __ARGS((char_u *(*fgetline)(int, void *, int), void *cookie, char_u *(*func)(int, void *, int)));
22 void *getline_cookie __ARGS((char_u *(*fgetline)(int, void *, int), void *cookie));
23 int checkforcmd __ARGS((char_u **pp, char *cmd, int len));
24 + int modifier_len __ARGS((char_u *cmd));
25 int cmd_exists __ARGS((char_u *name));
26 char_u *set_one_cmd_context __ARGS((expand_T *xp, char_u *buff));
27 char_u *skip_range __ARGS((char_u *cmd, int *ctx));
28 *** ../vim-7.1.161/src/ex_docmd.c Tue Nov 20 12:30:31 2007
29 --- src/ex_docmd.c Sat Nov 24 16:41:20 2007
35 #if defined(FEAT_EVAL) || defined(PROTO)
36 + static struct cmdmod
40 + int has_count; /* :123verbose :3tab */
42 + {"aboveleft", 3, FALSE},
43 + {"belowright", 3, FALSE},
44 + {"botright", 2, FALSE},
45 + {"browse", 3, FALSE},
46 + {"confirm", 4, FALSE},
48 + {"keepalt", 5, FALSE},
49 + {"keepjumps", 5, FALSE},
50 + {"keepmarks", 3, FALSE},
51 + {"leftabove", 5, FALSE},
52 + {"lockmarks", 3, FALSE},
53 + {"rightbelow", 6, FALSE},
54 + {"sandbox", 3, FALSE},
55 + {"silent", 3, FALSE},
57 + {"topleft", 2, FALSE},
58 + {"verbose", 4, TRUE},
59 + {"vertical", 4, FALSE},
63 + * Return length of a command modifier (including optional count).
64 + * Return zero when it's not a modifier.
73 + if (VIM_ISDIGIT(*cmd))
74 + p = skipwhite(skipdigits(cmd));
75 + for (i = 0; i < sizeof(cmdmods) / sizeof(struct cmdmod); ++i)
77 + for (j = 0; p[j] != NUL; ++j)
78 + if (p[j] != cmdmods[i].name[j])
80 + if (!isalpha(p[j]) && j >= cmdmods[i].minlen
81 + && (p == cmd || cmdmods[i].has_count))
82 + return j + (p - cmd);
88 * Return > 0 if an Ex command "name" exists.
89 * Return 2 if there is an exact match.
95 - static struct cmdmod
120 /* Check command modifiers. */
121 for (i = 0; i < sizeof(cmdmods) / sizeof(struct cmdmod); ++i)
123 *** ../vim-7.1.161/src/ex_eval.c Wed Aug 1 15:47:06 2007
124 --- src/ex_eval.c Sat Nov 24 16:34:09 2007
132 ! p = skipwhite(p + 1);
133 if ((p[0] == 'w' && p[1] == 'h')
134 || (p[0] == 'f' && p[1] == 'o' && p[2] == 'r'))
142 ! /* skip modifiers, white space and ':' */
145 ! while (*p == ' ' || *p == '\t' || *p == ':')
147 ! len = modifier_len(p);
152 if ((p[0] == 'w' && p[1] == 'h')
153 || (p[0] == 'f' && p[1] == 'o' && p[2] == 'r'))
155 *** ../vim-7.1.161/src/version.c Sat Nov 24 21:27:33 2007
156 --- src/version.c Sat Nov 24 21:48:38 2007
160 { /* Add new patch number below this line */
166 hundred-and-one symptoms of being an internet addict:
167 144. You eagerly await the update of the "Cool Site of the Day."
169 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
170 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
171 \\\ download, build and distribute -- http://www.A-A-P.org ///
172 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///