]> granicus.if.org Git - vim/commitdiff
updated for version 7.4b.012 v7.4b.012
authorBram Moolenaar <Bram@vim.org>
Sat, 3 Aug 2013 12:10:50 +0000 (14:10 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 3 Aug 2013 12:10:50 +0000 (14:10 +0200)
Problem:    Output from a shell command is truncated at a NUL. (lcd 47)
Solution:   Change every NUL into an SOH.

src/misc1.c
src/version.c

index 9581631787839ea72d379b8170b264fed9608043..11f456b804ed621cdab11578225dcfb2236f36db 100644 (file)
@@ -10887,7 +10887,14 @@ get_cmd_output(cmd, infile, flags)
        buffer = NULL;
     }
     else
+    {
+       /* Change NUL into SOH, otherwise the string is truncated. */
+       for (i = 0; i < len; ++i)
+           if (buffer[len] == NUL)
+               buffer[len] = 1;
+
        buffer[len] = NUL;      /* make sure the buffer is terminated */
+    }
 
 done:
     vim_free(tempname);
index 676245d7b1c51c4b30bc5dc899cc4df3fcc62be7..bf7c0e1949d35d752a15f81f2da52afddba343f6 100644 (file)
@@ -727,6 +727,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    12,
 /**/
     11,
 /**/