aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-01-23 02:09:59 +0300
committerZyX <kp-pav@yandex.ru>2017-01-23 02:09:59 +0300
commit61e04cae752578a959152b12f5ce8be4b54ff599 (patch)
tree94d17cbcb9d38f5afa71248d5ef8487b8b7784f6 /src
parent5369b0c7eac1711653aeecb8fcb8ca3a5f5fdfc1 (diff)
downloadrneovim-61e04cae752578a959152b12f5ce8be4b54ff599.tar.gz
rneovim-61e04cae752578a959152b12f5ce8be4b54ff599.tar.bz2
rneovim-61e04cae752578a959152b12f5ce8be4b54ff599.zip
ex_cmds: Also pass correct length in windows code
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_cmds.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index da629cd4a1..cf711552be 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -1416,24 +1416,22 @@ char_u *make_filter_cmd(char_u *cmd, char_u *itmp, char_u *otmp)
// the use of commands in a pipe.
strncpy(buf, cmd, len);
if (itmp != NULL) {
- char_u *p;
-
// If there is a pipe, we have to put the '<' in front of it.
// Don't do this when 'shellquote' is not empty, otherwise the
// redirection would be inside the quotes.
if (*p_shq == NUL) {
- p = strchr(buf, '|');
+ char *const p = strchr(buf, '|');
if (p != NULL) {
*p = NUL;
}
}
strncat(buf, " < ", len);
- strncat(buf, (char *) itmp, len);
+ strncat(buf, (const char *)itmp, len);
if (*p_shq == NUL) {
- p = strchr(cmd, '|');
+ const char *const p = strchr((const char *)cmd, '|');
if (p != NULL) {
- strncat(buf, " ", len); // Insert a space before the '|' for DOS
- strncat(buf, p, len);
+ strncat(buf, " ", len - 1); // Insert a space before the '|' for DOS
+ strncat(buf, p, len - 1);
}
}
}