diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-10-02 13:24:43 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-10-02 13:34:29 -0700 |
commit | 26a99cd8957db86bdc75d9d1ebf00146cb20c87c (patch) | |
tree | 2f65d57da589c9e5475902fdf08a4aa8c4294bda /gzread.c | |
parent | 3c9d261809bfafc4350147ade7b74022dd144d32 (diff) | |
download | zlib-26a99cd8957db86bdc75d9d1ebf00146cb20c87c.tar.gz zlib-26a99cd8957db86bdc75d9d1ebf00146cb20c87c.tar.bz2 zlib-26a99cd8957db86bdc75d9d1ebf00146cb20c87c.zip |
Add a transparent write mode to gzopen() when 'T' is in the mode.
Diffstat (limited to 'gzread.c')
-rw-r--r-- | gzread.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -535,16 +535,12 @@ int ZEXPORT gzdirect(file) | |||
535 | return 0; | 535 | return 0; |
536 | state = (gz_statep)file; | 536 | state = (gz_statep)file; |
537 | 537 | ||
538 | /* check that we're reading */ | ||
539 | if (state->mode != GZ_READ) | ||
540 | return 0; | ||
541 | |||
542 | /* if the state is not known, but we can find out, then do so (this is | 538 | /* if the state is not known, but we can find out, then do so (this is |
543 | mainly for right after a gzopen() or gzdopen()) */ | 539 | mainly for right after a gzopen() or gzdopen()) */ |
544 | if (state->how == LOOK && state->x.have == 0) | 540 | if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0) |
545 | (void)gz_look(state); | 541 | (void)gz_look(state); |
546 | 542 | ||
547 | /* return 1 if reading direct, 0 if decompressing a gzip stream */ | 543 | /* return 1 if transparent, 0 if processing a gzip stream */ |
548 | return state->direct; | 544 | return state->direct; |
549 | } | 545 | } |
550 | 546 | ||