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: remove redundant conditions



details:   https://anonhg.NetBSD.org/src/rev/a1950c71ca6e
branches:  trunk
changeset: 361106:a1950c71ca6e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Feb 09 21:28:57 2022 +0000

description:
make: remove redundant conditions

A line starting with '======' is parsed as a variable assignment, with
an empty variable name and a value starting with '=====', making that
condition unreachable.

No functional change.

diffstat:

 usr.bin/make/meta.c  |  5 ++---
 usr.bin/make/parse.c |  5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diffs (45 lines):

diff -r fe99c5842874 -r a1950c71ca6e usr.bin/make/meta.c
--- a/usr.bin/make/meta.c       Wed Feb 09 21:24:29 2022 +0000
+++ b/usr.bin/make/meta.c       Wed Feb 09 21:28:57 2022 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.197 2022/02/08 22:36:02 sjg Exp $ */
+/*      $NetBSD: meta.c,v 1.198 2022/02/09 21:28:57 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -1160,8 +1160,7 @@
        /* we want to track all the .meta we read */
        Global_Append(".MAKE.META.FILES", fname);
 
-       cmp_filter = metaCmpFilter ? metaCmpFilter :
-           Var_Exists(gn, MAKE_META_CMP_FILTER);
+       cmp_filter = metaCmpFilter || Var_Exists(gn, MAKE_META_CMP_FILTER);
 
        cmdNode = gn->commands.first;
        while (!oodate && (x = fgetLine(&buf, &bufsz, 0, fp)) > 0) {
diff -r fe99c5842874 -r a1950c71ca6e usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Wed Feb 09 21:24:29 2022 +0000
+++ b/usr.bin/make/parse.c      Wed Feb 09 21:28:57 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.665 2022/02/09 21:09:24 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.666 2022/02/09 21:28:57 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.665 2022/02/09 21:09:24 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.666 2022/02/09 21:28:57 rillig Exp $");
 
 /*
  * A file being read.
@@ -847,7 +847,6 @@
 InvalidLineType(const char *line)
 {
        if (strncmp(line, "<<<<<<", 6) == 0 ||
-           strncmp(line, "======", 6) == 0 ||
            strncmp(line, ">>>>>>", 6) == 0)
                Parse_Error(PARSE_FATAL,
                    "Makefile appears to contain unresolved CVS/RCS/??? merge conflicts");



Home | Main Index | Thread Index | Old Index