Mercurial > emacs
comparison lib-src/make-docfile.c @ 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 | dd3b83e4ceb0 |
children | 20652342eb9a |
comparison
equal
deleted
inserted
replaced
9642:d857ac857c27 | 9643:5d1e70b22a93 |
---|---|
55 int argc; | 55 int argc; |
56 char **argv; | 56 char **argv; |
57 { | 57 { |
58 int i; | 58 int i; |
59 int err_count = 0; | 59 int err_count = 0; |
60 int first_infile; | |
60 | 61 |
61 #ifdef MSDOS | 62 #ifdef MSDOS |
62 _fmode = O_BINARY; /* all of files are treated as binary files */ | 63 _fmode = O_BINARY; /* all of files are treated as binary files */ |
63 (stdout)->_flag &= ~_IOTEXT; | 64 (stdout)->_flag &= ~_IOTEXT; |
64 _setmode (fileno (stdout), O_BINARY); | 65 _setmode (fileno (stdout), O_BINARY); |
81 { | 82 { |
82 chdir (argv[i + 1]); | 83 chdir (argv[i + 1]); |
83 i += 2; | 84 i += 2; |
84 } | 85 } |
85 | 86 |
87 first_infile = i; | |
86 for (; i < argc; i++) | 88 for (; i < argc; i++) |
87 err_count += scan_file (argv[i]); /* err_count seems to be {mis,un}used */ | 89 { |
90 int j; | |
91 /* Don't process one file twice. */ | |
92 for (j = first_infile; j < i; j++) | |
93 if (! strcmp (argv[i], argv[j])) | |
94 break; | |
95 if (j == i) | |
96 err_count += scan_file (argv[i]); | |
97 } | |
88 #ifndef VMS | 98 #ifndef VMS |
89 exit (err_count); /* see below - shane */ | 99 exit (err_count > 0); |
90 #endif /* VMS */ | 100 #endif /* VMS */ |
91 return err_count; | 101 return err_count > 0; |
92 } | 102 } |
93 | 103 |
94 /* Read file FILENAME and output its doc strings to outfile. */ | 104 /* Read file FILENAME and output its doc strings to outfile. */ |
95 /* Return 1 if file is not found, 0 if it is found. */ | 105 /* Return 1 if file is not found, 0 if it is found. */ |
96 | 106 |