summary refs log tree commit diff
path: root/src/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/parser.c b/src/parser.c
index 3131045..54c2861 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -1565,10 +1565,11 @@ setprompt(int which)
 const char *
 expandstr(const char *ps)
 {
-	struct parsefile *volatile file_stop;
+	struct parsefile *file_stop;
 	struct jmploc *volatile savehandler;
-	const char *volatile result;
-	volatile int saveprompt;
+	struct heredoc *saveheredoclist;
+	const char *result;
+	int saveprompt;
 	struct jmploc jmploc;
 	union node n;
 	int err;
@@ -1578,6 +1579,8 @@ expandstr(const char *ps)
 	/* XXX Fix (char *) cast. */
 	setinputstring((char *)ps);
 
+	saveheredoclist = heredoclist;
+	heredoclist = NULL;
 	saveprompt = doprompt;
 	doprompt = 0;
 	result = ps;
@@ -1603,6 +1606,7 @@ out:
 
 	doprompt = saveprompt;
 	unwindfiles(file_stop);
+	heredoclist = saveheredoclist;
 
 	return result;
 }