]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
- patch from Michael Hohnbaum <hohnbaum@us.ibm.com> to handle sparse files.
authorjthomas <jthomas@localhost>
Sat, 7 Aug 2004 06:48:58 +0000 (06:48 +0000)
committerjthomas <jthomas@localhost>
Sat, 7 Aug 2004 06:48:58 +0000 (06:48 +0000)
ChangeLog
stage2/fsys_ext2fs.c

index d4c3d6a0d51ad103af6f2ff2f1ea14325b8114f8..cda87fcdf55453d31421b3b05968949dd5f48cb5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-08-07  Jason Thomas  <jason@staff.pnc.com.au>
+       From Michael Hohnbaum <hohnbaum@us.ibm.com>:
+       * stage2/fsys_ext2fs.c (ext2fs_read): Handle sparse files.
+
 2004-07-24  Yoshinori K. Okuji  <okuji@enbug.org>
 
        * stage2/stage2.c (cmain): Terminate DEFAULT_FILE with NUL
index ef37700961c871bed2dea63604522060162eeeb4..560048f4c5bf0e4ec9a36698d665d80949f0a7da 100644 (file)
@@ -432,12 +432,16 @@ ext2fs_read (char *buf, int len)
       if (size > len)
        size = len;
 
-      disk_read_func = disk_read_hook;
+      if (map == 0) {
+        memset ((char *) buf, 0, size);
+      } else {
+        disk_read_func = disk_read_hook;
 
-      devread (map * (EXT2_BLOCK_SIZE (SUPERBLOCK) / DEV_BSIZE),
-              offset, size, buf);
+        devread (map * (EXT2_BLOCK_SIZE (SUPERBLOCK) / DEV_BSIZE),
+                offset, size, buf);
 
-      disk_read_func = NULL;
+        disk_read_func = NULL;
+      }
 
       buf += size;
       len -= size;