From 941fa208541eee8b985715664466a0c88c3a7fc4 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 21 Apr 1995 02:14:40 +0000 Subject: (check_gzip): Rewind the stream before calling `get_method'. Open a new BFD on the uncompressed data stream before return. --- exec/exec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'exec') 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); } -- cgit v1.2.3