diff options
| author | rillig <rillig@NetBSD.org> | 2022-01-07 08:48:16 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2022-01-07 08:48:16 +0000 |
| commit | 4f434480412fa1604e64fe04b57b3abd4e2e3fe2 (patch) | |
| tree | dff1b456d35205f6d566fae17387538b4c678e39 /usr.bin/make/parse.c | |
| parent | 7cd1f3b838a3a524e431052b4de66be7879e553e (diff) | |
make: clean up nitpicks in parse.c
In PrintLocation, fname is not an iterator, so prefer fname[0] over
*fname.
List stdout and stderr in this order, for consistency with main.c.
No functional change.
Diffstat (limited to 'usr.bin/make/parse.c')
| -rw-r--r-- | usr.bin/make/parse.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index a1bfb4bced0..49f0ff6ecd4 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.621 2022/01/07 08:37:23 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.622 2022/01/07 08:48:16 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -106,7 +106,7 @@ #include "pathnames.h" /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: parse.c,v 1.621 2022/01/07 08:37:23 rillig Exp $"); +MAKE_RCSID("$NetBSD: parse.c,v 1.622 2022/01/07 08:48:16 rillig Exp $"); /* * Structure for a file being read ("included file") @@ -427,16 +427,11 @@ PrintLocation(FILE *f, const char *fname, size_t lineno) char dirbuf[MAXPATHLEN + 1]; FStr dir, base; - if (*fname == '/' || strcmp(fname, "(stdin)") == 0) { + if (fname[0] == '/' || strcmp(fname, "(stdin)") == 0) { (void)fprintf(f, "\"%s\" line %u: ", fname, (unsigned)lineno); return; } - /* - * Find out which makefile is the culprit. We try ${.PARSEDIR} and - * apply realpath(3) if not absolute. - */ - dir = Var_Value(SCOPE_GLOBAL, ".PARSEDIR"); if (dir.str == NULL) dir.str = "."; @@ -494,7 +489,7 @@ ParseErrorInternal(const char *fname, size_t lineno, ParseVErrorInternal(stderr, fname, lineno, type, fmt, ap); va_end(ap); - if (opts.debug_file != stderr && opts.debug_file != stdout) { + if (opts.debug_file != stdout && opts.debug_file != stderr) { va_start(ap, fmt); ParseVErrorInternal(opts.debug_file, fname, lineno, type, fmt, ap); @@ -531,7 +526,7 @@ Parse_Error(ParseErrorLevel type, const char *fmt, ...) ParseVErrorInternal(stderr, fname, lineno, type, fmt, ap); va_end(ap); - if (opts.debug_file != stderr && opts.debug_file != stdout) { + if (opts.debug_file != stdout && opts.debug_file != stderr) { va_start(ap, fmt); ParseVErrorInternal(opts.debug_file, fname, lineno, type, fmt, ap); @@ -1182,7 +1177,7 @@ AddToPaths(const char *dir, SearchPathList *paths) * a something and deal with it accordingly. */ static void -ParseDependencySourceSpecial(ParseSpecial special, char *word, +ParseDependencySourceSpecial(ParseSpecial special, const char *word, SearchPathList *paths) { switch (special) { |
