From ee3d37a591cf2db3dd1444b2c1e2fcb041f68d33 Mon Sep 17 00:00:00 2001
From: Paul Smith <psmith@gnu.org>
Date: Tue, 4 Nov 2003 07:40:29 +0000
Subject: Fix bugs 5798 and 6195.

---
 tests/scripts/functions/eval | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

(limited to 'tests/scripts/functions/eval')

diff --git a/tests/scripts/functions/eval b/tests/scripts/functions/eval
index cfb27b2..372aaf8 100644
--- a/tests/scripts/functions/eval
+++ b/tests/scripts/functions/eval
@@ -109,4 +109,29 @@ close(MAKEFILE);
 $answer = "[         9 8 7 6 5 4 3 2 1 0 ]\n";
 &compare_output($answer,&get_logfile(1));
 
+
+# TEST eval with no filename context.
+# The trick here is that because EVAR is taken from the environment, it must
+# be evaluated before every command is invoked.  Make sure that works, when
+# we have no file context for reading_file (bug # 6195)
+
+$makefile4 = &get_tmpfile;
+
+open(MAKEFILE,"> $makefile4");
+
+print MAKEFILE <<'EOF';
+EVAR = $(eval FOBAR = 1)
+all: ; @echo "OK"
+
+EOF
+
+close(MAKEFILE);
+
+$ENV{EVAR} = '1';
+&run_make_with_options($makefile4, "", &get_logfile);
+$answer = "OK\n";
+&compare_output($answer,&get_logfile(1));
+
+delete $ENV{EVAR};
+
 1;
-- 
cgit v1.2.3