From 4394c38352f0b007e45ed63678b0d28b1fa07316 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 1 Jan 1999 22:22:02 +0000 Subject: [PATCH] (cksum) [O_BINARY]: Read redirected stdin in binary mode. --- src/cksum.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.7.4