From 83aa1363ea0d39fda5c2625c1147a0751e24a2f4 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 28 Oct 2009 18:26:08 -0700 Subject: [PATCH] Add a warning message if an environment variable is not found. Instead of silently skipping the substitution we now print a warning message if an environment variable substitution is not found. --- driver/substit.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/driver/substit.c b/driver/substit.c index 1c2f1862e..833f45b80 100644 --- a/driver/substit.c +++ b/driver/substit.c @@ -19,6 +19,7 @@ # include # include +# include #ifdef HAVE_MALLOC_H # include #endif @@ -48,9 +49,13 @@ char* substitutions(const char*str) str = ep + 1; value = getenv(name); - free(name); if (value == 0) + fprintf(stderr, "Warning: environment variable " + "\"%s\" not found during command file " + "processing.\n", name); + free(name); continue; + free(name); if (strlen(value) >= (nbuf - (cp-buf))) { size_t old_size = cp - buf;