From ab2ec1b341f3d240b7668ab9af24148716971227 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 10 Jan 2016 11:02:18 +0300 Subject: [PATCH] (cpio_open_cpio_file): restore file offset after read of magic number. Signed-off-by: Andrew Borodin --- src/vfs/cpio/cpio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vfs/cpio/cpio.c b/src/vfs/cpio/cpio.c index 27703493c..77fb67cdf 100644 --- a/src/vfs/cpio/cpio.c +++ b/src/vfs/cpio/cpio.c @@ -234,7 +234,9 @@ cpio_open_cpio_file (struct vfs_class *me, struct vfs_s_super *super, const vfs_ arch->deferred = NULL; type = get_compression_type (fd, super->name); - if (type != COMPRESSION_NONE) + if (type == COMPRESSION_NONE) + mc_lseek (fd, 0, SEEK_SET); + else { char *s; vfs_path_t *tmp_vpath;