comparison src/ex_getln.c @ 3277:55cebc7e5de0 v7.3.407

updated for version 7.3.407 Problem: ":12verbose call F()" may duplicate text while trying to truncate. (Thinca) Solution: Only truncate when there is not enough room. Also check the byte length of the buffer.
author Bram Moolenaar <bram@vim.org>
date Fri, 20 Jan 2012 20:44:43 +0100
parents 6ff80dd02b51
children 821c8be2e9d6
comparison
equal deleted inserted replaced
3276:98958001bcfb 3277:55cebc7e5de0
5921 msg_putchar('\n'); 5921 msg_putchar('\n');
5922 sprintf((char *)IObuff, "%c%6d ", i == idx ? '>' : ' ', 5922 sprintf((char *)IObuff, "%c%6d ", i == idx ? '>' : ' ',
5923 hist[i].hisnum); 5923 hist[i].hisnum);
5924 if (vim_strsize(hist[i].hisstr) > (int)Columns - 10) 5924 if (vim_strsize(hist[i].hisstr) > (int)Columns - 10)
5925 trunc_string(hist[i].hisstr, IObuff + STRLEN(IObuff), 5925 trunc_string(hist[i].hisstr, IObuff + STRLEN(IObuff),
5926 (int)Columns - 10); 5926 (int)Columns - 10, IOSIZE - STRLEN(IObuff));
5927 else 5927 else
5928 STRCAT(IObuff, hist[i].hisstr); 5928 STRCAT(IObuff, hist[i].hisstr);
5929 msg_outtrans(IObuff); 5929 msg_outtrans(IObuff);
5930 out_flush(); 5930 out_flush();
5931 } 5931 }