From: Jim Meyering Date: Fri, 1 Jan 1999 22:22:02 +0000 (+0000) Subject: (cksum) [O_BINARY]: Read redirected stdin in binary mode. X-Git-Tag: FILEUTILS-4_1-b2~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4394c38352f0b007e45ed63678b0d28b1fa07316;p=platform%2Fupstream%2Fcoreutils.git (cksum) [O_BINARY]: Read redirected stdin in binary mode. --- diff --git a/src/cksum.c b/src/cksum.c index a8030e7..81d745d 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -1,5 +1,5 @@ /* cksum -- calculate and print POSIX.2 checksums and sizes of files - Copyright (C) 92, 95, 96, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 92, 1995-1998, 1999 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -217,6 +217,9 @@ cksum (char *file, int print_name) } } + /* Read input in BINARY mode, unless it is a console device. */ + SET_BINARY (fileno (fp)); + while ((bytes_read = fread (buf, 1, BUFLEN, fp)) > 0) { unsigned char *cp = buf;