Module Name: src
Committed By: rillig
Date: Thu Mar 3 19:50:01 UTC 2022
Modified Files:
src/usr.bin/make: str.c
Log Message:
make: make code for string matching syntactically more consistent
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/usr.bin/make/str.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/str.c
diff -u src/usr.bin/make/str.c:1.88 src/usr.bin/make/str.c:1.89
--- src/usr.bin/make/str.c:1.88 Wed Dec 15 10:57:01 2021
+++ src/usr.bin/make/str.c Thu Mar 3 19:50:01 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: str.c,v 1.88 2021/12/15 10:57:01 rillig Exp $ */
+/* $NetBSD: str.c,v 1.89 2022/03/03 19:50:01 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -71,7 +71,7 @@
#include "make.h"
/* "@(#)str.c 5.8 (Berkeley) 6/1/90" */
-MAKE_RCSID("$NetBSD: str.c,v 1.88 2021/12/15 10:57:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: str.c,v 1.89 2022/03/03 19:50:01 rillig Exp $");
static HashTable interned_strings;
@@ -364,9 +364,9 @@ Str_Match(const char *str, const char *p
if (pat[1] == '-') {
if (pat[2] == '\0')
return neg;
- if (*pat <= *str && pat[2] >= *str)
+ if (pat[0] <= *str && *str <= pat[2])
break;
- if (*pat >= *str && pat[2] <= *str)
+ if (pat[2] <= *str && *str <= pat[0])
break;
pat += 2;
}