=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-show-options.c,v retrieving revision 1.41 retrieving revision 1.42 diff -c -r1.41 -r1.42 *** src/usr.bin/tmux/cmd-show-options.c 2017/04/22 10:22:39 1.41 --- src/usr.bin/tmux/cmd-show-options.c 2017/05/10 13:05:41 1.42 *************** *** 1,4 **** ! /* $OpenBSD: cmd-show-options.c,v 1.41 2017/04/22 10:22:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-show-options.c,v 1.42 2017/05/10 13:05:41 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 128,152 **** struct options *oo) { struct args *args = self->args; struct options_entry *o; int idx, ambiguous; ! const char *name = args->argv[0]; o = options_match_get(oo, name, &idx, 1, &ambiguous); if (o == NULL) { ! if (args_has(args, 'q')) return (CMD_RETURN_NORMAL); if (ambiguous) { cmdq_error(item, "ambiguous option: %s", name); return (CMD_RETURN_ERROR); } if (*name != '@' && ! options_match_get(oo, name, &idx, 0, &ambiguous) != NULL) return (CMD_RETURN_NORMAL); cmdq_error(item, "unknown option: %s", name); return (CMD_RETURN_ERROR); } cmd_show_options_print(self, item, o, idx); return (CMD_RETURN_NORMAL); } --- 128,163 ---- struct options *oo) { struct args *args = self->args; + struct client *c = cmd_find_client(item, NULL, 1); + struct session *s = item->target.s; + struct winlink *wl = item->target.wl; struct options_entry *o; int idx, ambiguous; ! char *name; + name = format_single(item, args->argv[0], c, s, wl, NULL); o = options_match_get(oo, name, &idx, 1, &ambiguous); if (o == NULL) { ! if (args_has(args, 'q')) { ! free(name); return (CMD_RETURN_NORMAL); + } if (ambiguous) { cmdq_error(item, "ambiguous option: %s", name); + free(name); return (CMD_RETURN_ERROR); } if (*name != '@' && ! options_match_get(oo, name, &idx, 0, &ambiguous) != NULL) { ! free(name); return (CMD_RETURN_NORMAL); + } cmdq_error(item, "unknown option: %s", name); + free(name); return (CMD_RETURN_ERROR); } cmd_show_options_print(self, item, o, idx); + free(name); return (CMD_RETURN_NORMAL); }