escape: add flags argument to quote_command_line()

That way, we can reuse the call at one more place (see later patch).
This commit is contained in:
Lennart Poettering
2021-11-11 10:05:46 +01:00
parent a704137c20
commit 4ef15008cc
5 changed files with 10 additions and 11 deletions
+2 -2
View File
@@ -544,7 +544,7 @@ char* shell_maybe_quote(const char *s, ShellEscapeFlags flags) {
return str_realloc(buf);
}
char* quote_command_line(char **argv) {
char* quote_command_line(char **argv, ShellEscapeFlags flags) {
_cleanup_free_ char *result = NULL;
assert(argv);
@@ -553,7 +553,7 @@ char* quote_command_line(char **argv) {
STRV_FOREACH(a, argv) {
_cleanup_free_ char *t = NULL;
t = shell_maybe_quote(*a, SHELL_ESCAPE_EMPTY);
t = shell_maybe_quote(*a, flags);
if (!t)
return NULL;
+1 -1
View File
@@ -69,4 +69,4 @@ char* escape_non_printable_full(const char *str, size_t console_width, XEscapeFl
char* shell_escape(const char *s, const char *bad);
char* shell_maybe_quote(const char *s, ShellEscapeFlags flags);
char* quote_command_line(char **argv);
char* quote_command_line(char **argv, ShellEscapeFlags flags);