New version wasn't flushing last file after first hit eof.
authorMarc Teitelbaum <marc@ucbvax.Berkeley.EDU>
Thu, 26 Apr 1990 02:13:49 +0000 (18:13 -0800)
committerMarc Teitelbaum <marc@ucbvax.Berkeley.EDU>
Thu, 26 Apr 1990 02:13:49 +0000 (18:13 -0800)
SCCS-vsn: usr.bin/comm/comm.c 5.2

usr/src/usr.bin/comm/comm.c

index 0b6a496..9453187 100644 (file)
@@ -25,7 +25,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)comm.c     5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)comm.c     5.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/file.h>
 #endif /* not lint */
 
 #include <sys/file.h>
@@ -93,12 +93,12 @@ done:       argc -= optind;
                /* if one file done, display the rest of the other file */
                if (file1done) {
                        if (!file2done && col2)
                /* if one file done, display the rest of the other file */
                if (file1done) {
                        if (!file2done && col2)
-                               show(fp1, col2, line2);
+                               show(fp2, col2, line2);
                        break;
                }
                if (file2done) {
                        if (!file1done && col1)
                        break;
                }
                if (file2done) {
                        if (!file1done && col1)
-                               show(fp2, col1, line1);
+                               show(fp1, col1, line1);
                        break;
                }
 
                        break;
                }