PERFORCE change 63942 for review
John Baldwin
jhb at FreeBSD.org
Fri Oct 29 08:05:02 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=63942
Change 63942 by jhb at jhb_slimer on 2004/10/29 15:04:54
Overwrite the more prompt with spaces before continuing. This also
removes the need for the extra newline when quitting.
Affected files ...
.. //depot/projects/smpng/sys/ddb/db_output.c#12 edit
Differences ...
==== //depot/projects/smpng/sys/ddb/db_output.c#12 (text+ko) ====
@@ -198,10 +198,11 @@
void
db_simple_pager(void *arg)
{
- int c;
+ int c, done;
db_printf("--More--\r");
- for (;;) {
+ done = 0;
+ while (!done) {
c = cngetc();
switch (c) {
case 'e':
@@ -209,18 +210,21 @@
case '\n':
/* Just one more line. */
db_setup_paging(db_simple_pager, arg, 1);
- return;
+ done++;
+ break;
case 'd':
/* Half a page. */
db_setup_paging(db_simple_pager, arg,
db_lines_per_page / 2);
- return;
+ done++;
+ break;
case 'f':
case ' ':
/* Another page. */
db_setup_paging(db_simple_pager, arg,
db_lines_per_page);
- return;
+ done++;
+ break;
case 'q':
case 'Q':
case 'x':
@@ -228,8 +232,8 @@
/* Quit */
if (arg != NULL) {
*(int *)arg = 1;
- db_printf("\n");
- return;
+ done++;
+ break;
}
#if 0
/* FALLTHROUGH */
@@ -238,6 +242,7 @@
#endif
}
}
+ db_printf(" \r");
}
/*
More information about the p4-projects
mailing list