To: vim-dev@vim.org Subject: Patch 6.2.525 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.525 Problem: When the history contains a very long line ":history" causes a crash. (Volker Kiefel) Solution: Shorten the history entry to fit it in one line. Files: src/ex_getln.c *** ../vim-6.2.524/src/ex_getln.c Mon Apr 19 20:26:42 2004 --- src/ex_getln.c Tue May 4 19:21:08 2004 *************** *** 608,614 **** if (c == '=') { p = get_expr_line(); ! if (p != NULL && realloc_cmdbuff(STRLEN(p) + 1) == OK) { ccline.cmdlen = STRLEN(p); STRCPY(ccline.cmdbuff, p); --- 608,615 ---- if (c == '=') { p = get_expr_line(); ! if (p != NULL ! && realloc_cmdbuff((int)STRLEN(p) + 1) == OK) { ccline.cmdlen = STRLEN(p); STRCPY(ccline.cmdbuff, p); *************** *** 4809,4816 **** && hist[i].hisnum >= j && hist[i].hisnum <= k) { msg_putchar('\n'); ! sprintf((char *)IObuff, "%c%6d %s", i == idx ? '>' : ' ', ! hist[i].hisnum, hist[i].hisstr); msg_outtrans(IObuff); out_flush(); } --- 4810,4822 ---- && hist[i].hisnum >= j && hist[i].hisnum <= k) { msg_putchar('\n'); ! sprintf((char *)IObuff, "%c%6d ", i == idx ? '>' : ' ', ! hist[i].hisnum); ! if (vim_strsize(hist[i].hisstr) > (int)Columns - 10) ! trunc_string(hist[i].hisstr, IObuff + STRLEN(IObuff), ! (int)Columns - 10); ! else ! STRCAT(IObuff, hist[i].hisstr); msg_outtrans(IObuff); out_flush(); } *** ../vim-6.2.524/src/version.c Tue May 4 15:53:18 2004 --- src/version.c Tue May 4 19:22:08 2004 *************** *** 639,640 **** --- 642,645 ---- { /* Add new patch number below this line */ + /**/ + 525, /**/ -- hundred-and-one symptoms of being an internet addict: 106. When told to "go to your room" you inform your parents that you can't...because you were kicked out and banned. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///