From 9c589e694f3c235d723ae80533f3bf09a5ac3702 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sat, 16 Oct 2010 13:32:04 +0200 Subject: [PATCH] fold: fix fadvise hint * src/fold.c (fold_file): Apply fadvise to istream, not stdin. This bug would have inhibited the fadvise optimization when not reading from standard input. --- src/fold.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fold.c b/src/fold.c index d5858568ca..4da834b17f 100644 --- a/src/fold.c +++ b/src/fold.c @@ -143,7 +143,7 @@ fold_file (char const *filename, size_t width) return false; } - fadvise (stdin, FADVISE_SEQUENTIAL); + fadvise (istream, FADVISE_SEQUENTIAL); while ((c = getc (istream)) != EOF) { -- 2.47.2