=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/options.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- src/usr.bin/tmux/options.c 2019/05/12 18:16:33 1.44 +++ src/usr.bin/tmux/options.c 2019/05/23 11:13:30 1.45 @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.44 2019/05/12 18:16:33 nicm Exp $ */ +/* $OpenBSD: options.c,v 1.45 2019/05/23 11:13:30 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -353,8 +353,7 @@ { struct options_array_item *a; char *new; - struct cmd_list *cmdlist; - char *error; + struct cmd_parse_result *pr; if (!OPTIONS_IS_ARRAY(o)) { if (cause != NULL) @@ -363,13 +362,19 @@ } if (OPTIONS_IS_COMMAND(o)) { - cmdlist = cmd_string_parse(value, NULL, 0, &error); - if (cmdlist == NULL && error != NULL) { + pr = cmd_parse_from_string(value, NULL); + switch (pr->status) { + case CMD_PARSE_EMPTY: + *cause = xstrdup("empty command"); + return (-1); + case CMD_PARSE_ERROR: if (cause != NULL) - *cause = error; + *cause = pr->error; else - free(error); + free(pr->error); return (-1); + case CMD_PARSE_SUCCESS: + break; } } @@ -397,7 +402,7 @@ if (OPTIONS_IS_STRING(o)) a->value.string = new; else if (OPTIONS_IS_COMMAND(o)) - a->value.cmdlist = cmdlist; + a->value.cmdlist = pr->cmdlist; return (0); }