Refuse to perform file info from STDIN.

This commit is contained in:
ckolivas 2011-03-15 09:56:45 +11:00
parent 8a83741c32
commit fca5d4232c
2 changed files with 5 additions and 3 deletions

View file

@ -700,7 +700,7 @@ void get_fileinfo(rzip_control *control)
}
}
/* Version < 0.4 had different file format */
/* Versions 0.3-0.6 had different file formats */
if (control->major_version == 0 && control->minor_version < 4)
seekspot = 50;
else if (control->major_version == 0 && control->minor_version == 4)
@ -713,8 +713,7 @@ void get_fileinfo(rzip_control *control)
fatal("Failed to lseek in get_fileinfo\n");
/* Read the compression type of the first block. It's possible that
not all blocks are compressed so this may not be accurate.
*/
not all blocks are compressed so this may not be accurate. */
if (unlikely(read(fd_in, &ctype, 1) != 1))
fatal("Failed to read in get_fileinfo\n");

3
main.c
View file

@ -654,6 +654,9 @@ int main(int argc, char *argv[])
if (control.infile && (strcmp(control.infile, "-") == 0))
control.flags |= FLAG_STDIN;
if (INFO && STDIN)
failure("Will not get file info from STDIN\n");
if (control.outname && (strcmp(control.outname, "-") == 0)) {
control.flags |= FLAG_STDOUT;
control.msgout = stderr;