summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-04-21 02:14:40 +0000
committerRoland McGrath <roland@gnu.org>1995-04-21 02:14:40 +0000
commit941fa208541eee8b985715664466a0c88c3a7fc4 (patch)
treefe0ba1898a3ebf74c024b75b2fdd6731eb3e3b39
parenteb23806f805e3c680f075cb5f97d5c52e5476a56 (diff)
(check_gzip): Rewind the stream before calling `get_method'.
Open a new BFD on the uncompressed data stream before return.
-rw-r--r--exec/exec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/exec/exec.c b/exec/exec.c
index 42fbea3d..a547b80f 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -930,6 +930,7 @@ check_gzip (struct execdata *earg)
return;
}
+ rewind (&e->stream);
if (get_method (0) != 0)
{
/* Not a happy gzip file. */
@@ -970,7 +971,8 @@ check_gzip (struct execdata *earg)
e->stream.__bufp = e->stream.__buffer;
e->stream.__seen = 1;
- e->error = 0;
+ e->bfd = bfd_openstreamr (NULL, NULL, &e->stream);
+ e->error = e->bfd ? 0 : b2he (ENOEXEC);
}