From 40ad17721001a513ec00253de73451668bcf8e71 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Wed, 15 Jun 2005 23:33:54 +0000 Subject: [PATCH] revert erroneous help_init() changes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2683 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 6 +++--- src/nano.c | 19 ++++++++----------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ff0656d..7eb7c461 100644 --- a/ChangeLog +++ b/ChangeLog @@ -92,9 +92,9 @@ CVS code - affect tabs entered using verbatim input, and that it's disabled when NANO_SMALL is defined. Also, change the short command line option for --backupdir from -E to -C. Changes to - toggle_init(), help_init(), usage(), do_tab(), main(), - nanorc.sample, nano.1, nanorc.5, and nano.texi. (DLR, - suggested by many people) + toggle_init(), usage(), do_tab(), main(), nanorc.sample, + nano.1, nanorc.5, and nano.texi. (DLR, suggested by many + people) - chars.c: make_mbstring() - Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a diff --git a/src/nano.c b/src/nano.c index d8b6f691..d81a2bd9 100644 --- a/src/nano.c +++ b/src/nano.c @@ -509,7 +509,8 @@ void help_init(void) *(ptr++) = '\t'; } - /* Primary meta key sequence. */ + /* Primary meta key sequence. If it's the first entry, don't + * put parentheses around it. */ if (s->metaval != NANO_NO_KEY) { entries++; /* If this is the last entry, put it at the end. */ @@ -517,19 +518,15 @@ void help_init(void) entries++; *(ptr++) = '\t'; } - /* If the primary meta key sequence is the first entry, - * don't put parentheses around it. */ - if (entries == 1) { - /* Yucky sentinel values we can't handle a better - * way. */ - if (s->metaval == NANO_ALT_SPACE) { - char *space_ptr = display_string(_("Space"), 0, 5, + /* Yucky sentinel values that we can't handle a better + * way. */ + if (s->metaval == NANO_ALT_SPACE && entries == 1) { + char *space_ptr = display_string(_("Space"), 0, 5, FALSE); - ptr += sprintf(ptr, "M-%s", space_ptr); + ptr += sprintf(ptr, "M-%s", space_ptr); - free(space_ptr); - } + free(space_ptr); } else /* Normal values. */ ptr += sprintf(ptr, (entries == 1) ? "M-%c" : "(M-%c)", -- 2.39.5