X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=netinstall%2Ftar.cc;h=6149dd4f1cb5ec5ebe3ba3f9eac24c279739ec40;hp=8be129ead03543db28c7e3c944ca63a53f454d64;hb=a5812bf2ff9a9cf40f4ff78dcb83f5b4c295bd18;hpb=ccce6217f84987dff10ed3d2b60b9f0f65d8f25a diff --git a/netinstall/tar.cc b/netinstall/tar.cc index 8be129e..6149dd4 100644 --- a/netinstall/tar.cc +++ b/netinstall/tar.cc @@ -116,10 +116,37 @@ tar_open (char *pathname) return g ? 0 : 1; } +/* For some reason the cygwin version uses a function that is not in + the original source. We duplicate it here - although this does mean + revealing some internals. */ +extern "C" { + z_off_t ZEXPORT tar_gzctell (gzFile file); + typedef struct gz_stream { + z_stream stream; + int z_err; /* error code for last stream operation */ + int z_eof; /* set if end of input file */ + FILE *file; /* .gz file */ + Byte *inbuf; /* input buffer */ + Byte *outbuf; /* output buffer */ + uLong crc; /* crc32 of uncompressed data */ + char *msg; /* error message */ + char *path; /* path name for debugging only */ + int transparent; /* 1 if input file is not a .gz file */ + char mode; /* 'w' or 'r' */ + long startpos; /* start of compressed data in file (header skipped) */ + } gz_stream; +}; + +z_off_t ZEXPORT tar_gzctell (gzFile file) +{ + gz_stream *s = (gz_stream *)file; + return ftell(s->file); +} + int tar_ftell () { - return gztell (g); + return tar_gzctell (g); } static void @@ -482,7 +509,7 @@ tar_auto (char *pathname, char **maplist) if ((tar_open (pathname))) return 1; - while (c = tar_next_file ()) + while ((c = tar_next_file ())) { int l = strlen (c); for (i=0; i