Module Name: src
Committed By: rillig
Date: Sat Dec 5 19:06:51 UTC 2020
Modified Files:
src/usr.bin/make: parse.c
Log Message:
make(1): reduce indentation in ParseDependencySourceKeyword
To generate a diff of this commit:
cvs rdiff -u -r1.467 -r1.468 src/usr.bin/make/parse.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.467 src/usr.bin/make/parse.c:1.468
--- src/usr.bin/make/parse.c:1.467 Sat Dec 5 19:03:45 2020
+++ src/usr.bin/make/parse.c Sat Dec 5 19:06:51 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.467 2020/12/05 19:03:45 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.468 2020/12/05 19:06:51 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.467 2020/12/05 19:03:45 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.468 2020/12/05 19:06:51 rillig Exp $");
/* types and constants */
@@ -882,22 +882,26 @@ ParseDependencySourceWait(Boolean isSpec
static Boolean
ParseDependencySourceKeyword(const char *src, ParseSpecial specType)
{
+ int keywd;
+ GNodeType op;
- if (*src == '.' && ch_isupper(src[1])) {
- int keywd = ParseFindKeyword(src);
- if (keywd != -1) {
- GNodeType op = parseKeywords[keywd].op;
- if (op != 0) {
+ if (*src != '.' || !ch_isupper(src[1]))
+ return FALSE;
+
+ keywd = ParseFindKeyword(src);
+ if (keywd == -1)
+ return FALSE;
+
+ op = parseKeywords[keywd].op;
+ if (op != OP_NONE) {
ApplyDependencyOperator(op);
return TRUE;
- }
- if (parseKeywords[keywd].spec == SP_WAIT) {
- ParseDependencySourceWait(specType != SP_NOT);
+ }
+ if (parseKeywords[keywd].spec == SP_WAIT) {
+ ParseDependencySourceWait(specType != SP_NOT);
return TRUE;
- }
}
- }
- return FALSE;
+ return FALSE;
}
static void