diff 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
line wrap: on
line diff
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3258,9 +3258,8 @@ maketitle()
 	    if (maxlen > 0)
 	    {
 		/* make it shorter by removing a bit in the middle */
-		len = vim_strsize(buf);
-		if (len > maxlen)
-		    trunc_string(buf, buf, maxlen);
+		if (vim_strsize(buf) > maxlen)
+		    trunc_string(buf, buf, maxlen, IOSIZE);
 	    }
 	}
     }