suspending nano on the Hurd.
help_init()
- Typo fixes in help strings (Jordi).
+ - New variable helplen needes cause currslen is not always
+ the length we want (bug found by David Lawrence Ramsey).
- files.c:
read_file()
- Make conversion message less confusing (suggested by Jordi).
+- rcfile.c:
+ parse_next_word()
+ - Get rid of ptr == \n check to abort, screws up option
+ parsing (bug found by David Lawrence Ramsey)
- winio.c:
update_line()
- set realdata check to >= 1 && <= 31, lack of > 0 check screwed
#ifndef DISABLE_HELP
void help_init(void)
{
- int i, sofar = 0;
+ int i, sofar = 0, helplen;
long allocsize = 1; /* How much space we're gonna need for the help text */
char buf[BUFSIZ] = "", *ptr = NULL;
+ if (currslen == MAIN_VISIBLE)
+ helplen = MAIN_LIST_LEN;
+ else
+ helplen = currslen;
+
/* First set up the initial help text for the current function */
if (currshortcut == whereis_list || currshortcut == replace_list
|| currshortcut == replace_list_2)
/* 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 <= currslen - 1; i++)
+ for (i = 0; i <= helplen - 1; i++)
if (currshortcut[i].help != NULL)
allocsize += strlen(currshortcut[i].help) + 15;
strcpy(help_text, ptr);
/* Now add our shortcut info */
- for (i = 0; i <= currslen - 1; i++) {
+ for (i = 0; i <= helplen - 1; i++) {
if (currshortcut[i].val > 0 && currshortcut[i].val < 'a')
sofar = snprintf(buf, BUFSIZ, "^%c ", currshortcut[i].val + 64);
else
/* Parse the next word from the string. Returns NULL if we hit EOL */
char *parse_next_word(char *ptr)
{
- while (*ptr != ' ' && *ptr != '\t' && *ptr != '\n' && ptr != '\0')
+ while (*ptr != ' ' && *ptr != '\t' && *ptr != '\n' && *ptr != '\0')
ptr++;
- if (*ptr == '\0' || *ptr == '\n')
+ if (*ptr == '\0')
return NULL;
/* Null terminate and advance ptr */