mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Merge branch 'obsd-master'
Conflicts: Makefile tmux.1 window.c
This commit is contained in:
12
arguments.c
12
arguments.c
@ -125,7 +125,7 @@ args_free(struct args *args)
|
||||
size_t
|
||||
args_print(struct args *args, char *buf, size_t len)
|
||||
{
|
||||
size_t off;
|
||||
size_t off, used;
|
||||
int i;
|
||||
const char *quotes;
|
||||
struct args_entry *entry;
|
||||
@ -165,9 +165,12 @@ args_print(struct args *args, char *buf, size_t len)
|
||||
quotes = "\"";
|
||||
else
|
||||
quotes = "";
|
||||
off += xsnprintf(buf + off, len - off, "%s-%c %s%s%s",
|
||||
used = xsnprintf(buf + off, len - off, "%s-%c %s%s%s",
|
||||
off != 0 ? " " : "", entry->flag, quotes, entry->value,
|
||||
quotes);
|
||||
if (used > len - off)
|
||||
used = len - off;
|
||||
off += used;
|
||||
}
|
||||
|
||||
/* And finally the argument vector. */
|
||||
@ -181,8 +184,11 @@ args_print(struct args *args, char *buf, size_t len)
|
||||
quotes = "\"";
|
||||
else
|
||||
quotes = "";
|
||||
off += xsnprintf(buf + off, len - off, "%s%s%s%s",
|
||||
used = xsnprintf(buf + off, len - off, "%s%s%s%s",
|
||||
off != 0 ? " " : "", quotes, args->argv[i], quotes);
|
||||
if (used > len - off)
|
||||
used = len - off;
|
||||
off += used;
|
||||
}
|
||||
|
||||
return (off);
|
||||
|
Reference in New Issue
Block a user