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. --- cmd-select-prompt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd-select-prompt.c') diff --git a/cmd-select-prompt.c b/cmd-select-prompt.c index 182fef92..6f868252 100644 --- a/cmd-select-prompt.c +++ b/cmd-select-prompt.c @@ -1,4 +1,4 @@ -/* $Id: cmd-select-prompt.c,v 1.11 2009-07-28 22:12:16 tcunha Exp $ */ +/* $Id: cmd-select-prompt.c,v 1.12 2009-08-16 19:29:24 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -66,7 +66,7 @@ cmd_select_prompt_callback(void *data, const char *s) char msg[128]; u_int idx; - if (s == NULL) + if (s == NULL || *s == '\0') return (0); idx = strtonum(s, 0, UINT_MAX, &errstr); -- cgit