summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-08-27 20:01:11 +0100
committerThomas Adam <thomas@xteddy.org>2021-08-27 20:01:11 +0100
commit609baea95e30201919a173ea1de1f750a15a9f8c (patch)
tree68225d4bd3ba7e258cddb8e6b40f0764408a6e32 /client.c
parentc6375a0d4003d1008bb64e96e9c0c4433e4a5d13 (diff)
parentdaec63e5e6eb3390d53f4bf7f8a327df77e46c95 (diff)
Merge branch 'obsd-master' into master
Diffstat (limited to 'client.c')
-rw-r--r--client.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/client.c b/client.c
index fc0e1dde..8ca08524 100644
--- a/client.c
+++ b/client.c
@@ -243,6 +243,7 @@ client_main(struct event_base *base, int argc, char **argv, uint64_t flags,
ssize_t linelen;
char *line = NULL, **caps = NULL, *cause;
u_int ncaps = 0;
+ struct args_value *values;
/* Ignore SIGCHLD now or daemon() in the server will leave a zombie. */
signal(SIGCHLD, SIG_IGN);
@@ -258,17 +259,20 @@ client_main(struct event_base *base, int argc, char **argv, uint64_t flags,
msg = MSG_COMMAND;
/*
- * It sucks parsing the command string twice (in client and
- * later in server) but it is necessary to get the start server
- * flag.
+ * It's annoying parsing the command string twice (in client
+ * and later in server) but it is necessary to get the start
+ * server flag.
*/
- pr = cmd_parse_from_arguments(argc, argv, NULL);
+ values = args_from_vector(argc, argv);
+ pr = cmd_parse_from_arguments(values, argc, NULL);
if (pr->status == CMD_PARSE_SUCCESS) {
if (cmd_list_any_have(pr->cmdlist, CMD_STARTSERVER))
flags |= CLIENT_STARTSERVER;
cmd_list_free(pr->cmdlist);
} else
free(pr->error);
+ args_free_values(values, argc);
+ free(values);
}
/* Create client process structure (starts logging). */