diff -Nuar lzop-1.00/src/lzop.c lzop-1.00patch/src/lzop.c --- lzop-1.00/src/lzop.c Mon Apr 27 09:10:59 1998 +++ lzop-1.00patch/src/lzop.c Fri Mar 8 14:26:50 2002 @@ -2036,7 +2036,6 @@ if (opt_stdin) { - opt_unlink = 0; #if 0 /* gzip: always use stdout */ opt_stdout = 1; @@ -2068,8 +2067,12 @@ } /* check number of remaining args */ + if (opt_stdin == STDIN_GUESSED && i != argc) /* if guessed stdin and args remaining, we guessed wrong. */ + opt_stdin = 0; + if (opt_stdin) { + opt_unlink = 0; if (opt_cmd == CMD_COMPRESS && opt_output_path) { fprintf(stderr,"%s: cannot use `-p' when compressing stdin\n",argv0); @@ -2621,7 +2624,7 @@ /* accept "-" as synonym for stdin */ for (i = mfx_optind; i < argc; i++) if (strcmp(argv[i],"-") == 0) - opt_stdin = 1; + opt_stdin = STDIN_REQUESTED; /* explicitly requested to use stdin. OK. */ while (mfx_optind < argc && strcmp(argv[mfx_optind],"-") == 0) mfx_optind++; @@ -2803,7 +2806,9 @@ #endif set_term(stderr); - opt_stdin = isafile(STDIN_FILENO); + + /* GUESS if we want to use stdin. Will be double checked later. */ + opt_stdin = (isafile(STDIN_FILENO) ? STDIN_GUESSED : opt_stdin); UNUSED(foreground); #ifdef SIGINT @@ -2885,7 +2890,7 @@ { set_cmd(CMD_DECOMPRESS); if (i == argc) - opt_stdin = 1; + opt_stdin = STDIN_REQUESTED; /* explicitly set this, even though in if 0 preprocessor block.*/ if (!opt_output_name) opt_stdout = 1; break; diff -Nuar lzop-1.00/src/lzop.h lzop-1.00patch/src/lzop.h --- lzop-1.00/src/lzop.h Wed Apr 15 13:47:11 1998 +++ lzop-1.00patch/src/lzop.h Fri Mar 8 14:22:18 2002 @@ -311,6 +311,8 @@ #define STDERR_NAME "" #define UNKNOWN_NAME "" +#define STDIN_GUESSED 1 +#define STDIN_REQUESTED 2 /************************************************************************* //