commit 40ad17721001a513ec00253de73451668bcf8e71
parent 6f143c812404513fca824a9710f5ceedf927d089
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Wed, 15 Jun 2005 23:33:54 +0000
revert erroneous help_init() changes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2683 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git 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
@@ -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)",