summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/cmd_mem.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index ccf420a..4b524cf 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -1212,6 +1212,7 @@ int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned long src, dst;
unsigned long src_len = ~0UL, dst_len = ~0UL;
+ char buf[32];
switch (argc) {
case 4:
@@ -1225,7 +1226,14 @@ int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return cmd_usage(cmdtp);
}
- return !!gunzip((void *) dst, dst_len, (void *) src, &src_len);
+ if (gunzip((void *) dst, dst_len, (void *) src, &src_len) != 0)
+ return 1;
+
+ printf("Uncompressed size: %ld = 0x%lX\n", src_len, src_len);
+ sprintf(buf, "%lX", src_len);
+ setenv("filesize", buf);
+
+ return 0;
}
#endif /* CONFIG_CMD_UNZIP */