diff options
| author | rillig <rillig@NetBSD.org> | 2021-12-28 16:35:43 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2021-12-28 16:35:43 +0000 |
| commit | f94fe0a389ecc70958550060a385dbfec7cd308c (patch) | |
| tree | 8cccda111d7a59e2542e336af92fea49dca3e199 /usr.bin/make/parse.c | |
| parent | b2b9852f2571284085a0f4f636c4d5e3953cd7cd (diff) | |
make: make ParseIsEscape simpler
No functional change.
Diffstat (limited to 'usr.bin/make/parse.c')
| -rw-r--r-- | usr.bin/make/parse.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 77216b2a03a..fe90489b81e 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.593 2021/12/28 16:17:54 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.594 2021/12/28 16:35:43 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -109,7 +109,7 @@ #include "pathnames.h" /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: parse.c,v 1.593 2021/12/28 16:17:54 rillig Exp $"); +MAKE_RCSID("$NetBSD: parse.c,v 1.594 2021/12/28 16:35:43 rillig Exp $"); /* types and constants */ @@ -508,16 +508,12 @@ PrintStackTrace(void) /* Check if the current character is escaped on the current line. */ static bool -ParseIsEscaped(const char *line, const char *c) +ParseIsEscaped(const char *line, const char *p) { bool active = false; - for (;;) { - if (line == c) - return active; - if (*--c != '\\') - return active; + while (p > line && *--p == '\\') active = !active; - } + return active; } /* |
