Closed pete4abw closed 3 years ago
#define IS_FROM_FILE ( !!(control->inFILE) && !STDIN )
So control->inFILE only contains the C internal FILE stdin and STDIN merely indicates that.
control->inFILE
stdin
STDIN
Look at all the ways it is used in lrzip.c.
lrzip.c
lrzip.c: if (!STDIN && !IS_FROM_FILE) { lrzip.c: if ( IS_FROM_FILE ) { lrzip.c: if ( ! IS_FROM_FILE ) { lrzip.c: if ( IS_FROM_FILE ) lrzip.c: if (!STDIN && !IS_FROM_FILE) lrzip.c: if ( !IS_FROM_FILE ) lrzip.c: if (!STDIN && ! IS_FROM_FILE) close(fd_in); lrzip.c: if ( IS_FROM_FILE ) lrzip.c: if (! IS_FROM_FILE && STDIN && (fd_in > 0))
Seems counterintuitive. Does the following mean If it is NOT piped and NOT a file? No. It works out that it IS a file.
/* decompress one file from the command line */ bool decompress_file(rzip_control *control) { char *tmp, *tmpoutfile, *infilecopy = NULL; int fd_in, fd_out = -1, fd_hist = -1; i64 expected_size = 0, free_space; struct statvfs fbuf; if (!STDIN && !IS_FROM_FILE) {
See comment thread on #77 .
#define IS_FROM_FILE ( !!(control->inFILE) && !STDIN )
So
control->inFILE
only contains the C internal FILEstdin
andSTDIN
merely indicates that.Look at all the ways it is used in
lrzip.c
.Seems counterintuitive. Does the following mean If it is NOT piped and NOT a file? No. It works out that it IS a file.