]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(unexpand): Move EOF check to follow code that
authorJim Meyering <jim@meyering.net>
Fri, 26 Jul 1996 04:31:29 +0000 (04:31 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 26 Jul 1996 04:31:29 +0000 (04:31 +0000)
processes and generates output for pending spaces.
Before `printf '  ' |unexpand -t 1,2' generated no output.

src/unexpand.c

index 6d10022494ca8d028ebf0d466a5dab0497c776cc..b9ed275c3a9da4b9312d438538a807a77605f5ac 100644 (file)
@@ -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')