diff options
Diffstat (limited to 'usr.bin/tmux/arguments.c')
-rw-r--r-- | usr.bin/tmux/arguments.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/tmux/arguments.c b/usr.bin/tmux/arguments.c index f0e2e6dc55a..06d4cc2f03e 100644 --- a/usr.bin/tmux/arguments.c +++ b/usr.bin/tmux/arguments.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arguments.c,v 1.1 2011/01/04 00:42:46 nicm Exp $ */ +/* $OpenBSD: arguments.c,v 1.2 2011/01/30 12:09:30 nicm Exp $ */ /* * Copyright (c) 2010 Nicholas Marriott <nicm@users.sourceforge.net> @@ -183,11 +183,12 @@ args_has(struct args *args, u_char ch) void args_set(struct args *args, u_char ch, const char *value) { - if (value != NULL) { - if (args->values[ch] != NULL) - xfree(args->values[ch]); + if (args->values[ch] != NULL) + xfree(args->values[ch]); + if (value != NULL) args->values[ch] = xstrdup(value); - } + else + args->values[ch] = NULL; bit_set(args->flags, ch); } |