diff options
Diffstat (limited to 'src/unexpand.c')
| -rw-r--r-- | src/unexpand.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/unexpand.c b/src/unexpand.c index e9e5c6acf..14b8df08a 100644 --- a/src/unexpand.c +++ b/src/unexpand.c @@ -41,6 +41,7 @@ #include <sys/types.h> #include "system.h" #include "error.h" +#include "fadvise.h" #include "quote.h" #include "xstrndup.h" @@ -262,13 +263,14 @@ next_file (FILE *fp) if (STREQ (file, "-")) { have_read_stdin = true; - prev_file = file; - return stdin; + fp = stdin; } - fp = fopen (file, "r"); + else + fp = fopen (file, "r"); if (fp) { prev_file = file; + fadvise (fp, FADVISE_SEQUENTIAL); return fp; } error (0, errno, "%s", file); |
