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: do not evaluate ':gmtime' and ':localtime...



details:   https://anonhg.NetBSD.org/src/rev/7b53053b23f8
branches:  trunk
changeset: 1019584:7b53053b23f8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Mar 14 18:30:24 2021 +0000

description:
make: do not evaluate ':gmtime' and ':localtime' in parse-only mode

No functional change.

diffstat:

 usr.bin/make/var.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r 6108ef73f6d9 -r 7b53053b23f8 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Mar 14 18:23:44 2021 +0000
+++ b/usr.bin/make/var.c        Sun Mar 14 18:30:24 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.873 2021/03/14 18:23:44 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.874 2021/03/14 18:30:24 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.873 2021/03/14 18:23:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.874 2021/03/14 18:30:24 rillig Exp $");
 
 typedef enum VarFlags {
        VFL_NONE        = 0,
@@ -2568,8 +2568,9 @@
                *pp = mod + 6;
        }
 
-       Expr_SetValueOwn(st->expr,
-           VarStrftime(st->expr->value.str, TRUE, utc));
+       if (st->expr->eflags & VARE_WANTRES)
+               Expr_SetValueOwn(st->expr,
+                   VarStrftime(st->expr->value.str, TRUE, utc));
 
        return AMR_OK;
 }
@@ -2597,8 +2598,9 @@
                *pp = mod + 9;
        }
 
-       Expr_SetValueOwn(st->expr,
-           VarStrftime(st->expr->value.str, FALSE, utc));
+       if (st->expr->eflags & VARE_WANTRES)
+               Expr_SetValueOwn(st->expr,
+                   VarStrftime(st->expr->value.str, FALSE, utc));
 
        return AMR_OK;
 }



Home | Main Index | Thread Index | Old Index