Patch from Felipe Kellermann, fix endless loop when first > last and
[oweals/busybox.git] / archival / unzip.c
index c670073f4999c74ba72893f88a265ed456e55492..eea2f5438b67563a7b8371835dc78c70e89df3fb 100644 (file)
  *
  */
 
-/* For reference to format see http://www.pkware.com/support/appnote.html */
+/* For reference see
+ * http://www.pkware.com/products/enterprise/white_papers/appnote.txt
+ * http://www.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
+ */
 
 /* TODO Endian issues, exclude, should we accept input from stdin ? */
 
@@ -135,7 +138,7 @@ extern int unzip_main(int argc, char **argv)
        }
 
        if (*argv[optind] == '-') {
-               archive_handle->src_fd = fileno(stdin);
+               archive_handle->src_fd = STDIN_FILENO;
                archive_handle->seek = seek_by_char;
        } else {
                archive_handle->src_fd = bb_xopen(argv[optind++], O_RDONLY);