From: Colin Watson Date: Tue, 4 Jan 2011 15:41:07 +0000 (+0000) Subject: merge trunk X-Git-Tag: 1.99~64^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=944404efb8000d52eac1c292fa157b0ca48c4c2d;p=thirdparty%2Fgrub.git merge trunk --- 944404efb8000d52eac1c292fa157b0ca48c4c2d diff --cc grub-core/io/gzio.c index 248a1750e,f563d7b92..8b813fed3 --- a/grub-core/io/gzio.c +++ b/grub-core/io/gzio.c @@@ -216,21 -212,20 +216,20 @@@ test_gzip_header (grub_file_t file gzio->data_offset = grub_file_tell (gzio->file); - grub_file_seek (gzio->file, grub_file_size (gzio->file) - 4); - - if (grub_file_seekable (gzio->file)) - { - if (grub_file_read (gzio->file, &orig_len, 4) != 4) - { - grub_error (GRUB_ERR_BAD_FILE_TYPE, "unsupported gzip format"); - return 0; - } - } - /* FIXME: this does not handle files whose original size is over 4GB. - But how can we know the real original size? */ - file->size = grub_le_to_cpu32 (orig_len); + /* FIXME: don't do this on not easily seekable files. */ + { + grub_file_seek (gzio->file, grub_file_size (gzio->file) - 4); + if (grub_file_read (gzio->file, &orig_len, 4) != 4) + { + grub_error (GRUB_ERR_BAD_FILE_TYPE, "unsupported gzip format"); + return 0; + } + /* FIXME: this does not handle files whose original size is over 4GB. + But how can we know the real original size? */ + file->size = grub_le_to_cpu32 (orig_len); + } - initialize_tables (file); + initialize_tables (gzio); return 1; }