Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): clean up code in CondParser_String



details:   https://anonhg.NetBSD.org/src/rev/289c4770ed16
branches:  trunk
changeset: 943874:289c4770ed16
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Sep 12 17:14:40 2020 +0000

description:
make(1): clean up code in CondParser_String

The two parts of the for loop were not related in any way, which made
the code more confusing than necessary.

diffstat:

 usr.bin/make/cond.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 50a720a0f6d8 -r 289c4770ed16 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Sat Sep 12 16:46:24 2020 +0000
+++ b/usr.bin/make/cond.c       Sat Sep 12 17:14:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.137 2020/09/12 14:41:00 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.138 2020/09/12 17:14:40 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.137 2020/09/12 14:41:00 rillig Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.138 2020/09/12 17:14:40 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.137 2020/09/12 14:41:00 rillig Exp $");
+__RCSID("$NetBSD: cond.c,v 1.138 2020/09/12 17:14:40 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -419,7 +419,8 @@
     *quoted = qt = par->p[0] == '"' ? 1 : 0;
     if (qt)
        par->p++;
-    for (start = par->p; par->p[0] && str == NULL;) {
+    start = par->p;
+    while (par->p[0] && str == NULL) {
        switch (par->p[0]) {
        case '\\':
            par->p++;



Home | Main Index | Thread Index | Old Index