4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Crash with redir to unknown array. (Christian Brabandt)
12 Solution: Don't assign the redir result when there was an error.
16 *** ../vim-7.2.272/src/eval.c 2009-09-30 15:15:33.000000000 +0200
17 --- src/eval.c 2009-11-03 12:05:07.000000000 +0100
23 ! /* Make sure a valid variable name is specified */
24 if (!eval_isnamec1(*name))
30 redir_varname = vim_strsave(name);
31 if (redir_varname == NULL)
37 ! /* Catch a bad name early. */
38 if (!eval_isnamec1(*name))
44 + /* Make a copy of the name, it is used in redir_lval until redir ends. */
45 redir_varname = vim_strsave(name);
46 if (redir_varname == NULL)
54 + redir_endp = NULL; /* don't store a value, only cleanup */
61 did_emsg |= save_emsg;
64 + redir_endp = NULL; /* don't store a value, only cleanup */
73 * Stop redirecting command output to a variable.
74 + * Frees the allocated memory.
81 if (redir_lval != NULL)
83 ! /* Append the trailing NUL. */
84 ! ga_append(&redir_ga, NUL);
86 ! /* Assign the text to the variable. */
87 ! tv.v_type = VAR_STRING;
88 ! tv.vval.v_string = redir_ga.ga_data;
89 ! set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)".");
90 ! vim_free(tv.vval.v_string);
92 clear_lval(redir_lval);
96 if (redir_lval != NULL)
98 ! /* If there was no error: assign the text to the variable. */
99 ! if (redir_endp != NULL)
101 ! ga_append(&redir_ga, NUL); /* Append the trailing NUL. */
102 ! tv.v_type = VAR_STRING;
103 ! tv.vval.v_string = redir_ga.ga_data;
104 ! set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)".");
107 ! /* free the collected output */
108 ! vim_free(redir_ga.ga_data);
109 ! redir_ga.ga_data = NULL;
111 clear_lval(redir_lval);
112 vim_free(redir_lval);
113 *** ../vim-7.2.272/src/version.c 2009-11-03 13:06:03.000000000 +0100
114 --- src/version.c 2009-11-03 14:24:06.000000000 +0100
118 { /* Add new patch number below this line */
124 Permission is granted to read this message out aloud on Kings Cross Road,
125 London, under the condition that the orator is properly dressed.
127 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
128 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
129 \\\ download, build and distribute -- http://www.A-A-P.org ///
130 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///