summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/imgact_gzip.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/imgact_gzip.c b/sys/kern/imgact_gzip.c
index 6d021275df84..a9a6d3aa69bf 100644
--- a/sys/kern/imgact_gzip.c
+++ b/sys/kern/imgact_gzip.c
@@ -7,7 +7,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: imgact_gzip.c,v 1.4 1994/10/04 06:51:42 phk Exp $
+ * $Id: imgact_gzip.c,v 1.5 1994/10/05 00:58:33 phk Exp $
*
* This module handles execution of a.out files which have been run through
* "gzip -9".
@@ -389,6 +389,13 @@ Flush(struct gzip *gz,u_long siz)
}
}
}
+ /* Skip over zero-padded first PAGE if needed */
+ if(gz->output < gz->file_offset && (gz->output+siz) > gz->file_offset) {
+ i = min(siz, gz->file_offset - gz->output);
+ gz->output += i;
+ p += i;
+ siz -= i;
+ }
if(gz->output >= gz->file_offset && gz->output < gz->file_end) {
i = min(siz, gz->file_end - gz->output);
q = (u_char*) gz->virtual_offset + gz->output - gz->file_offset;