History

Plan 9 from Bell Labs Second Edition 1995-04-05

David du Colombier committed 31 years ago2e-1995-04-05

Commit 219b2ee1 parent bd389b311749 files · +2555453 −1889727Browse files

Showing the changes to sys/src/cmd/cpp/cpp.c (1 of 11749 files). Show all

Unified · Split

sys/src/cmd/cpp/cpp.c+7−5
@@ -16,7 +16,7 @@ int ifdepth; · 15 unmodified lines
1616 int ifsatisfied[NIF];
1717 int skipping;
1818
19−void
19+int
2020 main(int argc, char **argv)
2121 {
2222 Tokenrow tr;
@@ -36,6 +36,7 @@ main(int argc, char **argv) · 13 unmodified lines
3636 flushout();
3737 fflush(stderr);
3838 exits(nerrs? "errors" : 0);
39+ return 0;
3940 }
4041
4142 void
@@ -266,12 +267,13 @@ error(enum errtype type, char *string, ...) · 224 unmodified lines
266267 char *cp, *ep;
267268 Token *tp;
268269 Tokenrow *trp;
270+ Source *s;
269271 int i;
270272
271− if (*cursource->filename)
272− fprintf(stderr, "cpp: %s:%d: ", cursource->filename, cursource->line);
273− else
274− fprintf(stderr, "cpp: ");
273+ fprintf(stderr, "cpp: ");
274+ for (s=cursource; s; s=s->next)
275+ if (*s->filename)
276+ fprintf(stderr, "%s:%d ", s->filename, s->line);
275277 va_start(ap, string);
276278 for (ep=string; *ep; ep++) {
277279 if (*ep=='%') {