From: Sean Purcell Date: Thu, 16 Mar 2017 23:06:03 +0000 (-0700) Subject: Fix zstd not erroring on compressing to terminal without forceStdout X-Git-Tag: v1.2.0^2~103^2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8e52d3c83eeeeec088836b5840ee1ca307a612d;p=thirdparty%2Fzstd.git Fix zstd not erroring on compressing to terminal without forceStdout --- diff --git a/programs/zstdcli.c b/programs/zstdcli.c index ae49da7b1..fc7ca9e36 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -635,7 +635,7 @@ int main(int argCount, const char* argv[]) /* Check if input/output defined as console; trigger an error in this case */ if (!strcmp(filenameTable[0], stdinmark) && IS_CONSOLE(stdin) ) CLEAN_RETURN(badusage(programName)); - if (outFileName && !strcmp(outFileName, stdoutmark) && IS_CONSOLE(stdout) && strcmp(filenameTable[0], stdinmark) && !(forceStdout && (operation==zom_decompress))) + if (outFileName && !strcmp(outFileName, stdoutmark) && IS_CONSOLE(stdout) && !strcmp(filenameTable[0], stdinmark) && !forceStdout && operation!=zom_decompress) CLEAN_RETURN(badusage(programName)); /* user-selected output filename, only possible with a single file */