Previous patch missed one length decrement and thus was invalid. There was also
no need to introduce one new variable, here is the updated one. There is still
one issue: at the end of :file outputs garbage is shown meaning that something
is wrong. I currently do not know how to fix this or reproduce without using
aurum.
# HG changeset patch
# User ZyX <[email protected]>
# Date 1346991136 -14400
# Node ID d6b78f099bfb0b347935765f333cdfe4a5bf0e59
# Parent 1052677493beb941eab0d1e33d63c73ee4148350
Fixed handling of long paths in fileinfo.
diff -r 1052677493be -r d6b78f099bfb src/buffer.c
--- a/src/buffer.c Wed Sep 05 19:17:17 2012 +0200
+++ b/src/buffer.c Fri Sep 07 08:11:51 2012 +0400
@@ -3058,7 +3058,7 @@
*p++ = '"';
if (buf_spname(curbuf) != NULL)
- STRCPY(p, buf_spname(curbuf));
+ STRNCPY(p, buf_spname(curbuf), IOSIZE - (p-buffer) - 1);
else
{
if (!fullname && curbuf->b_fname != NULL)
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
*** /tmp/extdiff.87tUPy/vim.1052677493be/src/buffer.c 2012-09-07 08:16:01.000000000 +0400
--- vim.d6b78f099bfb/src/buffer.c 2012-09-07 08:16:01.000000000 +0400
***************
*** 3058,3064 ****
*p++ = '"';
if (buf_spname(curbuf) != NULL)
! STRCPY(p, buf_spname(curbuf));
else
{
if (!fullname && curbuf->b_fname != NULL)
--- 3058,3064 ----
*p++ = '"';
if (buf_spname(curbuf) != NULL)
! STRNCPY(p, buf_spname(curbuf), IOSIZE - (p-buffer) - 1);
else
{
if (!fullname && curbuf->b_fname != NULL)