Module Name:    src
Committed By:   rillig
Date:           Sat Jan 15 19:13:08 UTC 2022

Modified Files:
        src/usr.bin/make: make.h parse.c

Log Message:
make: use islower for parsing directives

None of the directives has an uppercase letter, so there is no need to
test for it.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.288 -r1.289 src/usr.bin/make/make.h
cvs rdiff -u -r1.650 -r1.651 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/make.h
diff -u src/usr.bin/make/make.h:1.288 src/usr.bin/make/make.h:1.289
--- src/usr.bin/make/make.h:1.288	Sun Jan  9 18:59:27 2022
+++ src/usr.bin/make/make.h	Sat Jan 15 19:13:08 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.288 2022/01/09 18:59:27 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.289 2022/01/15 19:13:08 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -874,6 +874,8 @@ ch_isalpha(char ch) { return isalpha((un
 MAKE_INLINE bool MAKE_ATTR_USE
 ch_isdigit(char ch) { return isdigit((unsigned char)ch) != 0; }
 MAKE_INLINE bool MAKE_ATTR_USE
+ch_islower(char ch) { return islower((unsigned char)ch) != 0; }
+MAKE_INLINE bool MAKE_ATTR_USE
 ch_isspace(char ch) { return isspace((unsigned char)ch) != 0; }
 MAKE_INLINE bool MAKE_ATTR_USE
 ch_isupper(char ch) { return isupper((unsigned char)ch) != 0; }

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.650 src/usr.bin/make/parse.c:1.651
--- src/usr.bin/make/parse.c:1.650	Sat Jan 15 18:34:41 2022
+++ src/usr.bin/make/parse.c	Sat Jan 15 19:13:08 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.650 2022/01/15 18:34:41 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.651 2022/01/15 19:13:08 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.650 2022/01/15 18:34:41 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.651 2022/01/15 19:13:08 rillig Exp $");
 
 /*
  * A file being read.
@@ -2636,7 +2636,7 @@ ParseDirective(char *line)
 	}
 
 	dir.start = cp;
-	while (ch_isalpha(*cp) || *cp == '-')
+	while (ch_islower(*cp) || *cp == '-')
 		cp++;
 	dir.end = cp;
 

Reply via email to