From b294dd43a13d45f3c11b4aa74264c357fda58b84 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 26 Jul 1996 04:31:29 +0000 Subject: [PATCH] (unexpand): Move EOF check to follow code that processes and generates output for pending spaces. Before `printf ' ' |unexpand -t 1,2' generated no output. --- src/unexpand.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/unexpand.c b/src/unexpand.c index 6d10022494..b9ed275c3a 100644 --- a/src/unexpand.c +++ b/src/unexpand.c @@ -249,14 +249,6 @@ unexpand (void) for (;;) { c = getc (fp); - if (c == EOF) - { - fp = next_file (fp); - if (fp == NULL) - break; /* No more files. */ - else - continue; - } if (c == ' ' && convert) { @@ -334,6 +326,15 @@ unexpand (void) } } + if (c == EOF) + { + fp = next_file (fp); + if (fp == NULL) + break; /* No more files. */ + else + continue; + } + if (convert) { if (c == '\b') -- 2.47.2