changeset 9643:5d1e70b22a93

(main): Don't process one input file twice. Never use exit code > 1.
author Richard M. Stallman <rms@gnu.org>
date Fri, 21 Oct 1994 20:31:43 +0000
parents d857ac857c27
children 2c7688eb344e
files lib-src/make-docfile.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/make-docfile.c	Fri Oct 21 20:29:30 1994 +0000
+++ b/lib-src/make-docfile.c	Fri Oct 21 20:31:43 1994 +0000
@@ -57,6 +57,7 @@
 {
   int i;
   int err_count = 0;
+  int first_infile;
 
 #ifdef MSDOS
   _fmode = O_BINARY;	/* all of files are treated as binary files */
@@ -83,12 +84,21 @@
       i += 2;
     }
 
+  first_infile = i;
   for (; i < argc; i++)
-    err_count += scan_file (argv[i]);	/* err_count seems to be {mis,un}used */
+    {
+      int j;
+      /* Don't process one file twice.  */
+      for (j = first_infile; j < i; j++)
+	if (! strcmp (argv[i], argv[j]))
+	  break;
+      if (j == i)
+	err_count += scan_file (argv[i]);
+    }
 #ifndef VMS
-  exit (err_count);			/* see below - shane */
+  exit (err_count > 0);
 #endif /* VMS */
-  return err_count;
+  return err_count > 0;
 }
 
 /* Read file FILENAME and output its doc strings to outfile.  */