Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: histlexwords error with >! token



On Jan 25,  7:52pm, Mikael Magnusson wrote:
} Subject: histlexwords error with >! token
}
} Even though the code appears to specially handle it, I still get this error,
}  hist.c:3477: bad(1) wordsplit reading history: echo hello >! /dev/null
} at: >! /dev/null
} word: >|

Try this:


diff --git a/Src/hist.c b/Src/hist.c
index 11d9722..87d0723 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -3452,7 +3452,8 @@ histsplitwords(char *lineptr, short **wordsp, int *nwordsp, int *nwordposp,
 			if (*lptr == *wptr ||
 			    (*lptr == '!' && *wptr == '|')) {
 			    lptr++;
-			    wptr++;
+			    if (!*++wptr)
+				break;
 			} else if (lptr[0] == '\\' &&
 				   lptr[1] == '\n') {
 			    /*



Messages sorted by: Reverse Date, Date, Thread, Author