mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-07 08:44:01 +01:00
parent
78305a7077
commit
c88870b0a3
14
arguments.c
14
arguments.c
@ -177,34 +177,20 @@ args_print(struct args *args)
|
||||
args_print_add(&buf, &len, " -%c ", entry->flag);
|
||||
else
|
||||
args_print_add(&buf, &len, "-%c ", entry->flag);
|
||||
#ifdef TMATE
|
||||
if (strchr(entry->value, '\'') != NULL)
|
||||
args_print_add(&buf, &len, "\"%s\"", entry->value);
|
||||
else
|
||||
args_print_add(&buf, &len, "'%s'", entry->value);
|
||||
#else
|
||||
if (strchr(entry->value, ' ') != NULL)
|
||||
args_print_add(&buf, &len, "\"%s\"", entry->value);
|
||||
else
|
||||
args_print_add(&buf, &len, "%s", entry->value);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* And finally the argument vector. */
|
||||
for (i = 0; i < args->argc; i++) {
|
||||
if (*buf != '\0')
|
||||
args_print_add(&buf, &len, " ");
|
||||
#ifdef TMATE
|
||||
if (strchr(args->argv[i], '\'') != NULL)
|
||||
args_print_add(&buf, &len, "\"%s\"", args->argv[i]);
|
||||
else
|
||||
args_print_add(&buf, &len, "'%s'", args->argv[i]);
|
||||
#else
|
||||
if (strchr(args->argv[i], ' ') != NULL)
|
||||
args_print_add(&buf, &len, "\"%s\"", args->argv[i]);
|
||||
else
|
||||
args_print_add(&buf, &len, "%s", args->argv[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
return (buf);
|
||||
|
Loading…
Reference in New Issue
Block a user