Commit 220ba692 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

help_init(): - Fix off by one error that was making ^G help in normal mode...

 help_init():  - Fix off by one error that was making ^G help in normal mode and ^_ in pico mode not be displayed in the help.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@412 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 51b3eec5
Showing with 6 additions and 3 deletions
+6 -3
......@@ -34,6 +34,9 @@ General
modify_control_key. Removed #ifdef _POSIX_VDISABLE check
around Control-S,Q,Z handlers because we need it now for
the Alt-Alt-x code.
help_init()
- Fix off by one error that was making ^G help in normal mode and
^_ in pico mode not be displayed in the help.
- nano.1, nano.1.html:
- Updated man page for -b, -e, -f and expanded explanation for -p.
- utils.c:
......
......@@ -1912,11 +1912,11 @@ void help_init(void)
{
int i, sofar = 0;
long allocsize = 1; /* How much space we're gonna need for the help text */
char buf[BUFSIZ];
char buf[BUFSIZ] = "";
/* Compute the space needed for the shortcut lists - we add 15 to
have room for the shortcut abbrev and its possible alternate keys */
for (i = 0; i < MAIN_LIST_LEN; i++)
for (i = 0; i <= MAIN_LIST_LEN - 1; i++)
if (main_list[i].help != NULL)
allocsize += strlen(main_list[i].help) + 15;
......@@ -1937,7 +1937,7 @@ void help_init(void)
strcpy(help_text, help_text_init);
/* Now add our shortcut info */
for (i = 0; i < MAIN_LIST_LEN - 1; i++) {
for (i = 0; i <= MAIN_LIST_LEN - 1; i++) {
sofar = snprintf(buf, BUFSIZ, "^%c ", main_list[i].val + 64);
if (main_list[i].misc1 > KEY_F0 && main_list[i].misc1 <= KEY_F(64))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment