summaryrefslogtreecommitdiff
path: root/lib-src/make-docfile.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-10-21 20:31:43 +0000
committerRichard M. Stallman <rms@gnu.org>1994-10-21 20:31:43 +0000
commita27897c9ac82a390879c4203746b2ec06062106c (patch)
tree8a579faac68d030c93960455372310593eb34f55 /lib-src/make-docfile.c
parentc3207e5d7229139706b226b2757a402e6ab526c5 (diff)
downloademacs-a27897c9ac82a390879c4203746b2ec06062106c.tar.gz
(main): Don't process one input file twice.
Never use exit code > 1.
Diffstat (limited to 'lib-src/make-docfile.c')
-rw-r--r--lib-src/make-docfile.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 72be211f868..cb500f0e6c2 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -57,6 +57,7 @@ main (argc, argv)
{
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 @@ main (argc, argv)
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. */