diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-12 18:16:34 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-12 18:16:34 +0000 |
commit | 9cc06177bfbc68eaaa608d7a3c416abfd825c184 (patch) | |
tree | ae4b3e94c1c0276b3c187389539adf9eb54d9da9 /usr.bin/tmux/options.c | |
parent | 49dd31dd5a852757b2818bb6cb06e47359a2805f (diff) |
Fix some indentation and dead assignments.
Diffstat (limited to 'usr.bin/tmux/options.c')
-rw-r--r-- | usr.bin/tmux/options.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/tmux/options.c b/usr.bin/tmux/options.c index 003f1547b6a..588f30d9b2f 100644 --- a/usr.bin/tmux/options.c +++ b/usr.bin/tmux/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.43 2019/04/26 11:38:51 nicm Exp $ */ +/* $OpenBSD: options.c,v 1.44 2019/05/12 18:16:33 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -354,16 +354,23 @@ options_array_set(struct options_entry *o, u_int idx, const char *value, struct options_array_item *a; char *new; struct cmd_list *cmdlist; + char *error; if (!OPTIONS_IS_ARRAY(o)) { - *cause = xstrdup("not an array"); + if (cause != NULL) + *cause = xstrdup("not an array"); return (-1); } if (OPTIONS_IS_COMMAND(o)) { - cmdlist = cmd_string_parse(value, NULL, 0, cause); - if (cmdlist == NULL && *cause != NULL) + cmdlist = cmd_string_parse(value, NULL, 0, &error); + if (cmdlist == NULL && error != NULL) { + if (cause != NULL) + *cause = error; + else + free(error); return (-1); + } } a = options_array_item(o, idx); |