=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/options-cmd.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** src/usr.bin/tmux/Attic/options-cmd.c 2009/06/01 22:58:49 1.1 --- src/usr.bin/tmux/Attic/options-cmd.c 2009/08/04 18:45:57 1.2 *************** *** 1,4 **** ! /* $OpenBSD: options-cmd.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: options-cmd.c,v 1.2 2009/08/04 18:45:57 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott *************** *** 25,39 **** void set_option_string(struct cmd_ctx *ctx, struct options *oo, ! const struct set_option_entry *entry, char *value) { if (value == NULL) { ctx->error(ctx, "empty value"); return; } ! options_set_string(oo, entry->name, "%s", value); ! ctx->info(ctx, "set option: %s -> %s", entry->name, value); } void --- 25,50 ---- void set_option_string(struct cmd_ctx *ctx, struct options *oo, ! const struct set_option_entry *entry, char *value, int append) { + char *oldvalue, *newvalue; + if (value == NULL) { ctx->error(ctx, "empty value"); return; } ! if (append) { ! oldvalue = options_get_string(oo, entry->name); ! xasprintf(&newvalue, "%s%s", oldvalue, value); ! } else ! newvalue = value; ! ! options_set_string(oo, entry->name, "%s", newvalue); ! ctx->info(ctx, "set option: %s -> %s", entry->name, newvalue); ! ! if (newvalue != value) ! xfree(newvalue); } void