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:
+2
-2
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user