Module Name: src
Committed By: kre
Date: Wed Jun 7 08:06:22 UTC 2017
Modified Files:
src/bin/sh: var.c
Log Message:
Unbreak (at least) i386 build .... I have no idea why this built for me on
amd64 (problem was missing prototype for snprintf witout <stdio.h>)
While here, add some (DEBUG mode only) tracing that proved useful in
solving another problem.
To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/bin/sh/var.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/var.c
diff -u src/bin/sh/var.c:1.57 src/bin/sh/var.c:1.58
--- src/bin/sh/var.c:1.57 Wed Jun 7 05:08:32 2017
+++ src/bin/sh/var.c Wed Jun 7 08:06:22 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.57 2017/06/07 05:08:32 kre Exp $ */
+/* $NetBSD: var.c,v 1.58 2017/06/07 08:06:22 kre Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -37,10 +37,11 @@
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: var.c,v 1.57 2017/06/07 05:08:32 kre Exp $");
+__RCSID("$NetBSD: var.c,v 1.58 2017/06/07 08:06:22 kre Exp $");
#endif
#endif /* not lint */
+#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
@@ -490,6 +491,7 @@ environment(void)
if ((vp->flags & (VEXPORT|VUNSET)) == VEXPORT)
nenv++;
}
+ CTRACE(DBG_VARS, ("environment: %d vars to export\n", nenv));
ep = env = stalloc((nenv + 1) * sizeof *env);
for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) {
for (vp = *vpp ; vp ; vp = vp->next)
@@ -498,6 +500,7 @@ environment(void)
*ep++ = (*vp->rfunc)(vp);
else
*ep++ = vp->text;
+ VTRACE(DBG_VARS, ("environment: %s\n", ep[-1]));
}
}
*ep = NULL;