]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(prjoin): Rewrite loop that iterates over field specs.
authorJim Meyering <jim@meyering.net>
Fri, 13 Oct 1995 13:16:34 +0000 (13:16 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 13 Oct 1995 13:16:34 +0000 (13:16 +0000)
src/join.c

index 59d240f62f4491ba8862f750a8cca1beb478eaae..f90b48f7a16e38c90c52ce67193842cbf7aeb188 100644 (file)
@@ -406,11 +406,14 @@ prjoin (struct line *line1, struct line *line2)
     {
       const struct outlist *o;
 
-      prfield (outlist->field - 1, outlist->file == 1 ? line1 : line2);
-      for (o = outlist->next; o; o = o->next)
+      o = outlist;
+      while (1)
        {
-         putchar (tab ? tab : ' ');
          prfield (o->field - 1, o->file == 1 ? line1 : line2);
+         o = o->next;
+         if (o == NULL)
+           break;
+         putchar (tab ? tab : ' ');
        }
       putchar ('\n');
     }