Module Name: src
Committed By: rillig
Date: Thu Oct 1 21:00:55 UTC 2020
Modified Files:
src/usr.bin/make: compat.c
Log Message:
make(1): add note about "..." with duplicate shell commands
To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/usr.bin/make/compat.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.159 src/usr.bin/make/compat.c:1.160
--- src/usr.bin/make/compat.c:1.159 Mon Sep 28 23:13:57 2020
+++ src/usr.bin/make/compat.c Thu Oct 1 21:00:55 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.159 2020/09/28 23:13:57 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.160 2020/10/01 21:00:55 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -99,7 +99,7 @@
#include "pathnames.h"
/* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.159 2020/09/28 23:13:57 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.160 2020/10/01 21:00:55 rillig Exp $");
static GNode *curTarg = NULL;
static void CompatInterrupt(int);
@@ -207,6 +207,11 @@ Compat_RunCommand(const char *cmdp, stru
errCheck = !(gn->type & OP_IGNORE);
doIt = FALSE;
+ /* Luckily the commands don't end up in a string pool, otherwise
+ * this comparison could match too early, in a dependency using "..."
+ * for delayed commands, run in parallel mode, using the same shell
+ * command line more than once; see JobPrintCommand.
+ * TODO: write a unit-test to protect against this potential bug. */
cmdNode = Lst_FindDatum(gn->commands, cmd);
(void)Var_Subst(cmd, gn, VARE_WANTRES, &cmdStart);
/* TODO: handle errors */