about summary refs log tree commit diff
path: root/Src/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/hist.c')
-rw-r--r--Src/hist.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Src/hist.c b/Src/hist.c
index 9f35c4cd2..a3d8fa7ef 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -2059,6 +2059,7 @@ mod_export LinkList
 bufferwords(LinkList list, char *buf, int *index)
 {
     int num = 0, cur = -1, got = 0, ne = noerrs, ocs = cs;
+    int owb = wb, owe = we, oadx = addedx, ozp = zleparse;
     char *p;
 
     if (!list)
@@ -2131,10 +2132,14 @@ bufferwords(LinkList list, char *buf, int *index)
     noaliases = 0;
     strinend();
     inpop();
-    errflag = zleparse = 0;
+    errflag = 0;
+    zleparse = ozp;
     noerrs = ne;
     lexrestore();
     cs = ocs;
+    wb = owb;
+    we = owe;
+    addedx = oadx;
 
     if (index)
 	*index = cur;