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.
This commit is contained in:
Tiago Cunha
2009-08-16 19:29:24 +00:00
parent 6f9a2ee50a
commit 646d6a929c
5 changed files with 16 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $Id: cmd-command-prompt.c,v 1.21 2009-07-28 22:12:16 tcunha Exp $ */
/* $Id: cmd-command-prompt.c,v 1.22 2009-08-16 19:29:24 tcunha Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -112,7 +112,7 @@ cmd_command_prompt_callback(void *data, const char *s)
char *cause, *ptr, *buf, ch;
size_t len, slen;
if (s == NULL)
if (s == NULL || *s == '\0')
return (0);
slen = strlen(s);