=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-set-option.c,v retrieving revision 1.96 retrieving revision 1.97 diff -u -r1.96 -r1.97 --- src/usr.bin/tmux/cmd-set-option.c 2016/05/30 09:50:20 1.96 +++ src/usr.bin/tmux/cmd-set-option.c 2016/09/26 09:02:34 1.97 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-set-option.c,v 1.96 2016/05/30 09:50:20 nicm Exp $ */ +/* $OpenBSD: cmd-set-option.c,v 1.97 2016/09/26 09:02:34 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -227,10 +227,11 @@ cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char *optstr, const char *valstr) { - struct args *args = self->args; - struct session *s = cmdq->state.tflag.s; - struct winlink *wl = cmdq->state.tflag.wl; - struct options *oo; + struct args *args = self->args; + struct session *s = cmdq->state.tflag.s; + struct winlink *wl = cmdq->state.tflag.wl; + struct options *oo; + struct options_entry *o; if (args_has(args, 's')) oo = global_options; @@ -262,18 +263,22 @@ } options_remove(oo, optstr); } else { - if (valstr == NULL) { - cmdq_error(cmdq, "empty value"); - return (CMD_RETURN_ERROR); - } - if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) { + o = options_find1(oo, optstr); + if (args_has(args, 'o') && o != NULL) { if (!args_has(args, 'q')) { cmdq_error(cmdq, "already set: %s", optstr); return (CMD_RETURN_ERROR); } return (CMD_RETURN_NORMAL); } - options_set_string(oo, optstr, "%s", valstr); + if (valstr == NULL) { + cmdq_error(cmdq, "empty value"); + return (CMD_RETURN_ERROR); + } + if (o != NULL && args_has(args, 'a')) + options_set_string(oo, optstr, "%s%s", o->str, valstr); + else + options_set_string(oo, optstr, "%s", valstr); } return (CMD_RETURN_NORMAL); }