To: vim-dev@vim.org Subject: Patch 6.1.255 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.255 (depends on 6.1.254) Problem: Crash when loading menu.vim a second time. (Christian Robinson) ":unlet garbage foo" tries unletting "foo" after an error message. (Servatius Brandt) Very long function arguments cause very long messages when 'verbose' is 14 or higher. Solution: Avoid reading from uninitialized memory. Break out of a loop after an invalid argument for ":unlet". Truncate long function arguments to 80 characters. Files: src/eval.c *** ../vim61.254/src/eval.c Mon Nov 11 21:42:40 2002 --- src/eval.c Tue Nov 12 21:06:53 2002 *************** *** 1097,1103 **** --- 1097,1106 ---- temp_string = make_expanded_name(arg, expr_start, expr_end, name_end); if (temp_string == NULL) + { EMSG2(_(e_invarg2), arg); + break; + } else { if (do_unlet(temp_string) == FAIL && !eap->forceit) *************** *** 8049,8055 **** * Accept 123_name() outside a script. */ if (skip) ! /* do nothing */; else if (lead > 0) { lead = 3; --- 8052,8058 ---- * Accept 123_name() outside a script. */ if (skip) ! lead = 0; /* do nothing */ else if (lead > 0) { lead = 3; *************** *** 8365,8371 **** smsg((char_u *)_("calling %s"), sourcing_name); if (p_verbose >= 14) { ! int i; msg_puts((char_u *)"("); for (i = 0; i < argcount; ++i) --- 8368,8375 ---- smsg((char_u *)_("calling %s"), sourcing_name); if (p_verbose >= 14) { ! int i; ! char_u buf[MSG_BUF_LEN]; msg_puts((char_u *)"("); for (i = 0; i < argcount; ++i) *************** *** 8376,8383 **** msg_outnum((long)argvars[i].var_val.var_number); else { msg_puts((char_u *)"\""); ! msg_puts(get_var_string(&argvars[i])); msg_puts((char_u *)"\""); } } --- 8380,8389 ---- msg_outnum((long)argvars[i].var_val.var_number); else { + trunc_string(get_var_string(&argvars[i]), + buf, MSG_BUF_LEN); msg_puts((char_u *)"\""); ! msg_puts(buf); msg_puts((char_u *)"\""); } } *** ../vim61.254/src/version.c Mon Nov 11 21:42:40 2002 --- src/version.c Tue Nov 12 22:43:56 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 255, /**/ -- hundred-and-one symptoms of being an internet addict: 22. You've already visited all the links at Yahoo and you're halfway through Lycos. /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///