From 646d6a929c81adbb978f88e14ff9b27dee0463d0 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Sun, 16 Aug 2009 19:29:24 +0000 Subject: Sync OpenBSD patchset 261: 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. --- status.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'status.c') diff --git a/status.c b/status.c index 850c513a..a8a7f34b 100644 --- a/status.c +++ b/status.c @@ -1,4 +1,4 @@ -/* $Id: status.c,v 1.109 2009-08-09 17:40:17 tcunha Exp $ */ +/* $Id: status.c,v 1.110 2009-08-16 19:29:24 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -920,14 +920,11 @@ status_prompt_key(struct client *c, int key) c->flags |= CLIENT_STATUS; break; case MODEKEYEDIT_ENTER: - if (*c->prompt_buffer != '\0') { + if (*c->prompt_buffer != '\0') status_prompt_add_history(c); - if (c->prompt_callbackfn( - c->prompt_data, c->prompt_buffer) == 0) - status_prompt_clear(c); - break; - } - /* FALLTHROUGH */ + if (c->prompt_callbackfn(c->prompt_data, c->prompt_buffer) == 0) + status_prompt_clear(c); + break; case MODEKEYEDIT_CANCEL: if (c->prompt_callbackfn(c->prompt_data, NULL) == 0) status_prompt_clear(c); -- cgit