summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-08-03 14:10:50 +0200
committerBram Moolenaar <Bram@vim.org>2013-08-03 14:10:50 +0200
commitfb332a2b33ddbbaa172b32148640b9b3c92a8dc0 (patch)
tree4dcfc83f955cf5a41d2dfd321fcceddefffdd23a /src/misc1.c
parentc528b1d1edb5ab87242704c82422ae363647603c (diff)
downloadvim-git-fb332a2b33ddbbaa172b32148640b9b3c92a8dc0.tar.gz
updated for version 7.4b.012v7.4b.012
Problem: Output from a shell command is truncated at a NUL. (lcd 47) Solution: Change every NUL into an SOH.
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/misc1.c b/src/misc1.c
index 958163178..11f456b80 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -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);