Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Cond_reset_depth just use cond_min_depth



details:   https://anonhg.NetBSD.org/src/rev/92c041a522b2
branches:  trunk
changeset: 370673:92c041a522b2
user:      sjg <sjg%NetBSD.org@localhost>
date:      Fri Sep 23 22:58:15 2022 +0000

description:
Cond_reset_depth just use cond_min_depth

To avoid errors from unclosed conditionals on .break
it is sufficient to just set cond_depth = cond_min_depth.

Patch from rillig

diffstat:

 usr.bin/make/cond.c  |  8 ++++----
 usr.bin/make/make.h  |  4 ++--
 usr.bin/make/parse.c |  6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diffs (73 lines):

diff -r 63f678de20b4 -r 92c041a522b2 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Fri Sep 23 19:04:04 2022 +0000
+++ b/usr.bin/make/cond.c       Fri Sep 23 22:58:15 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.337 2022/09/08 05:52:56 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.338 2022/09/23 22:58:15 sjg 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.337 2022/09/08 05:52:56 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.338 2022/09/23 22:58:15 sjg Exp $");
 
 /*
  * Conditional expressions conform to this grammar:
@@ -1284,7 +1284,7 @@
  * when the loop started.
  */
 void
-Cond_reset_depth(unsigned int depth)
+Cond_reset_depth(void)
 {
-    cond_depth = depth;
+    cond_depth = cond_min_depth;
 }
diff -r 63f678de20b4 -r 92c041a522b2 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Fri Sep 23 19:04:04 2022 +0000
+++ b/usr.bin/make/make.h       Fri Sep 23 22:58:15 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.304 2022/09/02 16:24:31 sjg Exp $   */
+/*     $NetBSD: make.h,v 1.305 2022/09/23 22:58:15 sjg Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -800,7 +800,7 @@
 CondResult Cond_EvalCondition(const char *) MAKE_ATTR_USE;
 CondResult Cond_EvalLine(const char *) MAKE_ATTR_USE;
 void Cond_restore_depth(unsigned int);
-void Cond_reset_depth(unsigned int);
+void Cond_reset_depth(void);
 unsigned int Cond_save_depth(void) MAKE_ATTR_USE;
 
 /* dir.c; see also dir.h */
diff -r 63f678de20b4 -r 92c041a522b2 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Fri Sep 23 19:04:04 2022 +0000
+++ b/usr.bin/make/parse.c      Fri Sep 23 22:58:15 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.683 2022/09/03 00:50:07 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.684 2022/09/23 22:58:15 sjg Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -105,7 +105,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.683 2022/09/03 00:50:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.684 2022/09/23 22:58:15 sjg Exp $");
 
 /*
  * A file being read.
@@ -2669,7 +2669,7 @@
        if (curFile->forLoop != NULL) {
                /* pretend we reached EOF */
                For_Break(curFile->forLoop);
-               Cond_reset_depth(curFile->cond_depth);
+               Cond_reset_depth();
                ParseEOF();
        } else
                Parse_Error(PARSE_FATAL, "break outside of for loop");



Home | Main Index | Thread Index | Old Index