From: Jim Meyering Date: Fri, 26 Jul 1996 04:31:29 +0000 (+0000) Subject: (unexpand): Move EOF check to follow code that X-Git-Tag: TEXTUTILS-1_19b~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b294dd43a13d45f3c11b4aa74264c357fda58b84;p=thirdparty%2Fcoreutils.git (unexpand): Move EOF check to follow code that processes and generates output for pending spaces. Before `printf ' ' |unexpand -t 1,2' generated no output. --- 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')