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 doing Insert mode completion for a user defined
12 command. (Yegappan Lakshmanan)
13 Solution: Don't use the non-existing command line.
17 *** ../vim-7.1.232/src/ex_getln.c Fri Jan 4 15:16:57 2008
18 --- src/ex_getln.c Fri Jan 18 13:07:11 2008
21 static void * call_user_expand_func __ARGS((void *(*user_expand_func) __ARGS((char_u *, int, char_u **, int)), expand_T *xp, int *num_file, char_u ***file));
24 ! * call "user_expand_func()" to invoke a user defined VimL function and return
25 * the result (either a string or a List).
29 static void * call_user_expand_func __ARGS((void *(*user_expand_func) __ARGS((char_u *, int, char_u **, int)), expand_T *xp, int *num_file, char_u ***file));
32 ! * Call "user_expand_func()" to invoke a user defined VimL function and return
33 * the result (either a string or a List).
41 ! keep = ccline.cmdbuff[ccline.cmdlen];
42 ! ccline.cmdbuff[ccline.cmdlen] = 0;
43 ! sprintf((char *)num, "%d", ccline.cmdpos);
44 args[0] = xp->xp_pattern;
45 - args[1] = ccline.cmdbuff;
48 /* Save the cmdline, we don't know what the function may do. */
53 ! if (ccline.cmdbuff == NULL)
55 ! /* Completion from Insert mode, pass fake arguments. */
57 ! sprintf((char *)num, "%d", STRLEN(xp->xp_pattern));
58 ! args[1] = xp->xp_pattern;
62 ! /* Completion on the command line, pass real arguments. */
63 ! keep = ccline.cmdbuff[ccline.cmdlen];
64 ! ccline.cmdbuff[ccline.cmdlen] = 0;
65 ! sprintf((char *)num, "%d", ccline.cmdpos);
66 ! args[1] = ccline.cmdbuff;
68 args[0] = xp->xp_pattern;
71 /* Save the cmdline, we don't know what the function may do. */
76 current_SID = save_current_SID;
78 ! ccline.cmdbuff[ccline.cmdlen] = keep;
85 current_SID = save_current_SID;
86 ! if (ccline.cmdbuff != NULL)
87 ! ccline.cmdbuff[ccline.cmdlen] = keep;
91 *** ../vim-7.1.232/src/version.c Fri Jan 18 11:40:02 2008
92 --- src/version.c Fri Jan 18 13:01:05 2008
96 { /* Add new patch number below this line */
102 "I love deadlines. I especially like the whooshing sound they
103 make as they go flying by."
106 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
107 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
108 \\\ download, build and distribute -- http://www.A-A-P.org ///
109 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///