summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-confirm-before.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-08-13 23:44:18 +0000
committernicm <nicm@openbsd.org>2009-08-13 23:44:18 +0000
commit6d0edb75af2816d0ed9067977bfd9e0a1a09c129 (patch)
tree77228b3a1685eff4aeeec321e9e5b7cf42219c2c /usr.bin/tmux/cmd-confirm-before.c
parentRemove unrelated bit from last commit which breaks at least 2 arches. (diff)
downloadwireguard-openbsd-6d0edb75af2816d0ed9067977bfd9e0a1a09c129.tar.xz
wireguard-openbsd-6d0edb75af2816d0ed9067977bfd9e0a1a09c129.zip
Switch the prompt code to return an empty string when the user enters no
response and reserve NULL for an explicit cancel. Change all callbacks to treat them the same so no functional change. Also add cancel key bindings to emacs mode which were missing.
Diffstat (limited to 'usr.bin/tmux/cmd-confirm-before.c')
-rw-r--r--usr.bin/tmux/cmd-confirm-before.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-confirm-before.c b/usr.bin/tmux/cmd-confirm-before.c
index e4fd9e2617a..87ce4c24969 100644
--- a/usr.bin/tmux/cmd-confirm-before.c
+++ b/usr.bin/tmux/cmd-confirm-before.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-confirm-before.c,v 1.6 2009/07/26 12:58:44 nicm Exp $ */
+/* $OpenBSD: cmd-confirm-before.c,v 1.7 2009/08/13 23:44:18 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -107,7 +107,9 @@ cmd_confirm_before_callback(void *data, const char *s)
struct cmd_ctx ctx;
char *cause;
- if (s == NULL || tolower((u_char) s[0]) != 'y' || s[1] != '\0')
+ if (s == NULL || *s == '\0')
+ return (0);
+ if (tolower((u_char) s[0]) != 'y' || s[1] != '\0')
return (0);
if (cmd_string_parse(cdata->cmd, &cmdlist, &cause) != 0) {