From 266e0496ab96e28eeee8c95a96e2cc1e66ef5849 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 27 Jul 2014 19:32:03 +0000 Subject: [PATCH] Using the more direct func_from_key() wrapper instead of get_shortcut(). git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5082 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ src/prompt.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 425f6dc5..76795d71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ addition ability from this builder function of the shortcut list. * src/global.c (strtokeytype): Move this to a better place. * src/global.c (first_sc_for): Move this too to a better place. + * src/prompt.c (do_yesno_prompt): Use the new and more direct + func_from_key() wrapper instead of get_shortcut(). 2014-07-24 Jordi Mallach * doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix. diff --git a/src/prompt.c b/src/prompt.c index f3511c82..6a1e99f1 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -1045,7 +1045,6 @@ int do_yesno_prompt(bool all, const char *msg) const char *yesstr; /* String of Yes characters accepted. */ const char *nostr; /* Same for No. */ const char *allstr; /* And All, surprise! */ - const sc *s; int oldmenu = currmenu; assert(msg != NULL); @@ -1106,15 +1105,16 @@ int do_yesno_prompt(bool all, const char *msg) do { int kbinput; + functionptrtype func; #ifndef DISABLE_MOUSE int mouse_x, mouse_y; #endif currmenu = MYESNO; kbinput = get_kbinput(bottomwin); - s = get_shortcut(&kbinput); + func = func_from_key(&kbinput); - if (s && s->scfunc == do_cancel) + if (func == do_cancel) ok = -1; #ifndef DISABLE_MOUSE else if (kbinput == KEY_MOUSE) { @@ -1146,7 +1146,7 @@ int do_yesno_prompt(bool all, const char *msg) } } #endif /* !DISABLE_MOUSE */ - else if (s && s->scfunc == total_refresh) { + else if (func == total_refresh) { total_redraw(); continue; } else { -- 2.39.5