summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-01-20 20:44:43 +0100
committerBram Moolenaar <Bram@vim.org>2012-01-20 20:44:43 +0100
commitf31b764c23ae9a91cd6119f57aee6ea80ec480d2 (patch)
tree534ff4ba7b47ee9789801b4e7f80fa2fef0e249e /src/buffer.c
parent3ef7cdf0fd040e7247bd395b51b107df0da081ef (diff)
downloadvim-git-f31b764c23ae9a91cd6119f57aee6ea80ec480d2.tar.gz
updated for version 7.3.407v7.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.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 2884b3038..8cf5f8ac0 100644
--- 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);
}
}
}