refactor: remove redundant const char * casts

This commit is contained in:
ii14
2023-04-07 19:40:57 +02:00
committed by GitHub
parent 1d2a29f75b
commit 9408f2dcf7
56 changed files with 302 additions and 350 deletions

View File

@@ -1388,7 +1388,7 @@ char *make_filter_cmd(char *cmd, char *itmp, char *otmp)
if (is_pwsh) {
if (itmp != NULL) {
xstrlcpy(buf, "& { Get-Content ", len - 1); // FIXME: should we add "-Encoding utf8"?
xstrlcat(buf, (const char *)itmp, len - 1);
xstrlcat(buf, itmp, len - 1);
xstrlcat(buf, " | & ", len - 1); // FIXME: add `&` ourself or leave to user?
xstrlcat(buf, cmd, len - 1);
xstrlcat(buf, " }", len - 1);
@@ -1409,7 +1409,7 @@ char *make_filter_cmd(char *cmd, char *itmp, char *otmp)
if (itmp != NULL) {
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
@@ -1426,9 +1426,9 @@ char *make_filter_cmd(char *cmd, char *itmp, char *otmp)
}
}
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);