aboutsummaryrefslogtreecommitdiff
path: root/gzread.c
diff options
context:
space:
mode:
Diffstat (limited to 'gzread.c')
-rw-r--r--gzread.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gzread.c b/gzread.c
index 4701f9e..521e26f 100644
--- a/gzread.c
+++ b/gzread.c
@@ -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