Fixed exiting from pager using the `q' key while paging

"help index" or "help <topic>" with list of subtopics.
This commit is contained in:
Ruslan Ermilov 2004-09-29 13:43:55 +00:00
parent 9ccab60d32
commit 4d0cb59f0f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135929

View File

@ -100,7 +100,7 @@ help_getnext(int fd, char **topic, char **subtopic, char **desc)
}
}
static void
static int
help_emitsummary(char *topic, char *subtopic, char *desc)
{
int i;
@ -119,7 +119,7 @@ help_emitsummary(char *topic, char *subtopic, char *desc)
} while (i++ < 30);
pager_output(desc);
}
pager_output("\n");
return (pager_output("\n"));
}
@ -162,7 +162,8 @@ command_help(int argc, char *argv[])
while(help_getnext(hfd, &t, &s, &d)) {
if (doindex) { /* dink around formatting */
help_emitsummary(t, s, d);
if (help_emitsummary(t, s, d))
break;
} else if (strcmp(topic, t)) {
/* topic mismatch */
@ -183,7 +184,8 @@ command_help(int argc, char *argv[])
}
} else if ((subtopic == NULL) && (s != NULL)) {
/* topic match, list subtopics */
help_emitsummary(t, s, d);
if (help_emitsummary(t, s, d))
break;
}
}
free(t);