ppcrcd/trunk/yaboot/yaboot.c

sparky cvs at pld-linux.org
Sun Mar 26 00:12:41 CET 2006


Author: sparky
Date: Sun Mar 26 00:12:37 2006
New Revision: 7320

Modified:
   ppcrcd/trunk/yaboot/yaboot.c
Log:
- rewritten for not to use seek(); now it works with FAT partition


Modified: ppcrcd/trunk/yaboot/yaboot.c
==============================================================================
--- ppcrcd/trunk/yaboot/yaboot.c	(original)
+++ ppcrcd/trunk/yaboot/yaboot.c	Sun Mar 26 00:12:37 2006
@@ -341,14 +341,16 @@
 					nlp = strrchr(msg, '\n');
 				}
 			}
-			*++nlp = '\0';
-			len += nlp - msg;
+			c = *++nlp;
+			*nlp = '\0';
 
 			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);
+			len = nlp - msg; /* displayed message length */
+			*nlp = c;
+			memcpy(msg, nlp, 2000 - len);
+			memset(msg + (2000 - len), 0, len);
+			file.fs->read(&file, len, msg + (2000 - len));
 			msg[2000] = '\0';
 
 			/* wait until key */
@@ -358,6 +360,7 @@
 				goto done;
 			}
 		}
+		prom_printf("\r                   \rUnexpected end of file\n");
 	} else
 		prom_printf("%s", msg);
 


More information about the pld-cvs-commit mailing list