comparison src/buffer.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 683fab13904c
children 9ccdc4a69d8f
comparison
equal deleted inserted replaced
3276:98958001bcfb 3277:55cebc7e5de0
3256 STRCAT(buf, " - VIM"); 3256 STRCAT(buf, " - VIM");
3257 3257
3258 if (maxlen > 0) 3258 if (maxlen > 0)
3259 { 3259 {
3260 /* make it shorter by removing a bit in the middle */ 3260 /* make it shorter by removing a bit in the middle */
3261 len = vim_strsize(buf); 3261 if (vim_strsize(buf) > maxlen)
3262 if (len > maxlen) 3262 trunc_string(buf, buf, maxlen, IOSIZE);
3263 trunc_string(buf, buf, maxlen);
3264 } 3263 }
3265 } 3264 }
3266 } 3265 }
3267 mustset = ti_change(t_str, &lasttitle); 3266 mustset = ti_change(t_str, &lasttitle);
3268 3267