]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-02-02 Christian Franke <franke@computer.org>
authorchrfranke <chrfranke@localhost>
Mon, 2 Feb 2009 19:43:14 +0000 (19:43 +0000)
committerchrfranke <chrfranke@localhost>
Mon, 2 Feb 2009 19:43:14 +0000 (19:43 +0000)
* lib/hexdump.c (hexdump): Print at most 3 lines if data is identical.

ChangeLog
lib/hexdump.c

index ce45490ed5e27b37c446d24e021b16e91bcfd628..53ba5e67bc5493db3967d534ca817928697d91d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-02-02  Christian Franke  <franke@computer.org>
+
+       * lib/hexdump.c (hexdump): Print at most 3 lines if data is identical.
+
 2009-02-01  Felix Zielcke  <fzielcke@z-51.de>
 
        * INSTALL: Note that we now require at least autconf 2.59 and that LZO
index 9b79f45b8fc4ce24ef8bb0c4b430cd00fdf43e19..c69cb093b7da66829d85a5d5f02cd5052c818ae1 100644 (file)
@@ -61,6 +61,22 @@ hexdump (unsigned long bse, char *buf, int len)
 
       grub_printf ("%s\n", line);
 
+      /* Print only first and last line if more than 3 lines are identical.  */
+      if (len >= 4 * 16
+         && ! grub_memcmp (buf, buf + 1 * 16, 16)
+         && ! grub_memcmp (buf, buf + 2 * 16, 16)
+         && ! grub_memcmp (buf, buf + 3 * 16, 16))
+       {
+         grub_printf ("*\n");
+         do
+           {
+             bse += 16;
+             buf += 16;
+             len -= 16;
+           }
+         while (len >= 3 * 16 && ! grub_memcmp (buf, buf + 2 * 16, 16));
+       }
+
       bse += 16;
       buf += 16;
       len -= cnt;