1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

(main): Don't process one input file twice.

Never use exit code > 1.
This commit is contained in:
Richard M. Stallman 1994-10-21 20:31:43 +00:00
parent c3207e5d72
commit a27897c9ac

View file

@ -57,6 +57,7 @@ main (argc, argv)
{ {
int i; int i;
int err_count = 0; int err_count = 0;
int first_infile;
#ifdef MSDOS #ifdef MSDOS
_fmode = O_BINARY; /* all of files are treated as binary files */ _fmode = O_BINARY; /* all of files are treated as binary files */
@ -83,12 +84,21 @@ main (argc, argv)
i += 2; i += 2;
} }
first_infile = i;
for (; i < argc; 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 #ifndef VMS
exit (err_count); /* see below - shane */ exit (err_count > 0);
#endif /* VMS */ #endif /* VMS */
return err_count; return err_count > 0;
} }
/* Read file FILENAME and output its doc strings to outfile. */ /* Read file FILENAME and output its doc strings to outfile. */