Author: sparky
Date: Sat Mar 25 22:25:47 2006
New Revision: 7318

Modified:
   ppcrcd/trunk/yaboot/yaboot.c
Log:
- cleaned test paging code


Modified: ppcrcd/trunk/yaboot/yaboot.c
==============================================================================
--- ppcrcd/trunk/yaboot/yaboot.c        (original)
+++ ppcrcd/trunk/yaboot/yaboot.c        Sat Mar 25 22:25:47 2006
@@ -323,6 +323,7 @@
 
        if ( paging ) {
                char *nlp;
+               int c;
                int len = 0;
                int new_lines;
 
@@ -332,21 +333,30 @@
                        while (--new_lines > 0) {
                                nlp = strchr((nlp+1), '\n');
                                if ( nlp == NULL ) { /* less than 20 lines */
-                                       prom_printf("\r         \r%s", msg);
-                                       goto done;
+                                       if ( msg[1999] == '\0' ) {
+                                               /* end of file */
+                                               prom_printf("\r                 
  \r%s", msg);
+                                               goto done;
+                                       }
+                                       nlp = strrchr(msg, '\n');
                                }
                        }
                        *++nlp = '\0';
-
-                       prom_printf("\r         \r%s[Press a key]", msg);
                        len += nlp - msg;
 
+                       prom_printf("\r                   \r%s[Press a key, or 
Q]", msg);
+
                        memset(msg, 0, 2001);
                        file.fs->seek(&file, len);
                        file.fs->read(&file, 2000, msg);
+                       msg[2000] = '\0';
 
                        /* wait until key */
-                       while ( prom_nbgetchar() == -1 );
+                       while ( (c = prom_nbgetchar()) == -1 );
+                       if ( c == 'q' || c == 'Q' ) {
+                               prom_printf("\r                   \r");
+                               goto done;
+                       }
                }
        } else
                prom_printf("%s", msg);
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to