aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 0f351d8af6..bd8c099579 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -1579,11 +1579,11 @@ char *make_filter_cmd(char *cmd, char *itmp, char *otmp)
size_t len = STRLEN(cmd) + 1; // At least enough space for cmd + NULL.
len += is_fish_shell ? sizeof("begin; " "; end") - 1
- : is_pwsh ? STRLEN("Start-Process ")
+ : is_pwsh ? sizeof("Start-Process ")
: sizeof("(" ")") - 1;
if (itmp != NULL) {
- len += is_pwsh ? STRLEN(itmp) + STRLEN(" -RedirectStandardInput ")
+ len += is_pwsh ? STRLEN(itmp) + sizeof(" -RedirectStandardInput ")
: STRLEN(itmp) + sizeof(" { " " < " " } ") - 1;
}
if (otmp != NULL) {
@@ -1596,7 +1596,7 @@ char *make_filter_cmd(char *cmd, char *itmp, char *otmp)
// redirecting input and/or output.
if (is_pwsh) {
xstrlcpy(buf, "Start-Process ", len);
- xstrlcat(buf, (char *)cmd, len);
+ xstrlcat(buf, cmd, len);
} else if (itmp != NULL || otmp != NULL) {
char *fmt = is_fish_shell ? "begin; %s; end"
: "(%s)";
@@ -1611,16 +1611,16 @@ char *make_filter_cmd(char *cmd, char *itmp, char *otmp)
} else {
xstrlcat(buf, " < ", len - 1);
}
- xstrlcat(buf, (const char *)itmp, len - 1);
+ xstrlcat(buf, itmp, len - 1);
}
#else
// For shells that don't understand braces around commands, at least allow
// the use of commands in a pipe.
if (is_pwsh) {
xstrlcpy(buf, "Start-Process ", len);
- xstrlcat(buf, (char *)cmd, len);
+ xstrlcat(buf, cmd, len);
} else {
- xstrlcpy(buf, (char *)cmd, len);
+ xstrlcpy(buf, cmd, len);
}
if (itmp != NULL) {
// If there is a pipe, we have to put the '<' in front of it.
@@ -1637,9 +1637,9 @@ char *make_filter_cmd(char *cmd, char *itmp, char *otmp)
} else {
xstrlcat(buf, " < ", len);
}
- xstrlcat(buf, (const char *)itmp, len);
+ xstrlcat(buf, itmp, len);
if (*p_shq == NUL) {
- const char *const p = find_pipe((const char *)cmd);
+ const char *const p = find_pipe(cmd);
if (p != NULL) {
xstrlcat(buf, " ", len - 1); // Insert a space before the '|' for DOS
xstrlcat(buf, p, len - 1);