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 calling string() on a recurively nested List.
12 Solution: Check result value for being NULL. (Yukihiro Nakadaira)
16 *** ../vim-7.1.073/src/eval.c Mon Aug 6 22:27:12 2007
17 --- src/eval.c Tue Aug 14 22:01:12 2007
20 * "numbuf" is used for a number.
21 * Does not put quotes around strings, as ":echo" displays values.
22 * When "copyID" is not NULL replace recursive lists and dicts with "...".
26 echo_string(tv, tofree, numbuf, copyID)
28 * "numbuf" is used for a number.
29 * Does not put quotes around strings, as ":echo" displays values.
30 * When "copyID" is not NULL replace recursive lists and dicts with "...".
34 echo_string(tv, tofree, numbuf, copyID)
37 * If the memory is allocated "tofree" is set to it, otherwise NULL.
38 * "numbuf" is used for a number.
39 * Puts quotes around strings, so that they can be parsed back by eval().
43 tv2string(tv, tofree, numbuf, copyID)
45 * If the memory is allocated "tofree" is set to it, otherwise NULL.
46 * "numbuf" is used for a number.
47 * Puts quotes around strings, so that they can be parsed back by eval().
51 tv2string(tv, tofree, numbuf, copyID)
56 p1 = tv2string(&(*(listitem_T **)s1)->li_tv, &tofree1, numbuf1, 0);
57 p2 = tv2string(&(*(listitem_T **)s2)->li_tv, &tofree2, numbuf2, 0);
63 res = STRICMP(p1, p2);
68 rettv->v_type = VAR_STRING;
69 rettv->vval.v_string = tv2string(&argvars[0], &tofree, numbuf, 0);
71 rettv->vval.v_string = vim_strsave(rettv->vval.v_string);
76 rettv->v_type = VAR_STRING;
77 rettv->vval.v_string = tv2string(&argvars[0], &tofree, numbuf, 0);
78 ! /* Make a copy if we have a value but it's not in allocate memory. */
79 ! if (rettv->vval.v_string != NULL && tofree == NULL)
80 rettv->vval.v_string = vim_strsave(rettv->vval.v_string);
86 char_u buf[MSG_BUF_LEN];
87 char_u numbuf2[NUMBUFLEN];
91 msg_puts((char_u *)"(");
92 for (i = 0; i < argcount; ++i)
95 msg_outnum((long)argvars[i].vval.v_number);
98 ! trunc_string(tv2string(&argvars[i], &tofree,
99 ! numbuf2, 0), buf, MSG_BUF_CLEN);
104 msg_puts((char_u *)")");
106 msg_outnum((long)argvars[i].vval.v_number);
109 ! s = tv2string(&argvars[i], &tofree, numbuf2, 0);
112 ! trunc_string(s, buf, MSG_BUF_CLEN);
118 msg_puts((char_u *)")");
121 char_u buf[MSG_BUF_LEN];
122 char_u numbuf2[NUMBUFLEN];
125 /* The value may be very long. Skip the middle part, so that we
126 * have some idea how it starts and ends. smsg() would always
127 * truncate it at the end. */
128 ! trunc_string(tv2string(fc.rettv, &tofree, numbuf2, 0),
129 ! buf, MSG_BUF_CLEN);
130 ! smsg((char_u *)_("%s returning %s"), sourcing_name, buf);
133 msg_puts((char_u *)"\n"); /* don't overwrite this either */
136 char_u buf[MSG_BUF_LEN];
137 char_u numbuf2[NUMBUFLEN];
141 /* The value may be very long. Skip the middle part, so that we
142 * have some idea how it starts and ends. smsg() would always
143 * truncate it at the end. */
144 ! s = tv2string(fc.rettv, &tofree, numbuf2, 0);
147 ! trunc_string(s, buf, MSG_BUF_CLEN);
148 ! smsg((char_u *)_("%s returning %s"), sourcing_name, buf);
152 msg_puts((char_u *)"\n"); /* don't overwrite this either */
154 *** ../vim-7.1.073/src/version.c Tue Aug 14 22:15:53 2007
155 --- src/version.c Tue Aug 14 22:27:24 2007
159 { /* Add new patch number below this line */
165 hundred-and-one symptoms of being an internet addict:
166 159. You get excited whenever discussing your hard drive.
168 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
169 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
170 \\\ download, build and distribute -- http://www.A-A-P.org ///
171 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///