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): make CondParser_String simpler



details:   https://anonhg.NetBSD.org/src/rev/f0122e71f1a8
branches:  trunk
changeset: 950217:f0122e71f1a8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Jan 21 13:51:24 2021 +0000

description:
make(1): make CondParser_String simpler

No functional change.

diffstat:

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

diffs (34 lines):

diff -r e3888603aefa -r f0122e71f1a8 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Thu Jan 21 13:32:17 2021 +0000
+++ b/usr.bin/make/cond.c       Thu Jan 21 13:51:24 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.245 2021/01/21 13:31:38 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.246 2021/01/21 13:51:24 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.245 2021/01/21 13:31:38 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.246 2021/01/21 13:51:24 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -437,12 +437,10 @@
                        }
                        continue;
                case '"':
-                       if (quoted) {
-                               par->p++;       /* skip the closing quote */
-                               goto got_str;
-                       }
-                       Buf_AddByte(&buf, par->p[0]); /* likely? */
                        par->p++;
+                       if (quoted)
+                               goto got_str;   /* skip the closing quote */
+                       Buf_AddByte(&buf, '"');
                        continue;
                case ')':       /* see is_separator */
                case '!':



Home | Main Index | Thread Index | Old Index