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

PATCH: pws-20: fix remhist() crash



Here's a fix for the crash in remhist().  It causes some calls to
remhist() to be ignored as invalid.  I'm still looking at the
calling code to try to figure out a better fix than this, but this
should keep the shell from crashing for now.

..wayne..

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: Src/hist.c
--- zsh-3.1.5-pws-20/Src/hist.c	Mon May 17 00:34:25 1999
+++ ./Src/hist.c	Sun Jun  6 21:18:59 1999
@@ -984,6 +984,8 @@
 void
 remhist(void)
 {
+    if (hist_ring == &curline)
+	return;
     if (!(histactive & HA_ACTIVE)) {
 	if (!(histactive & HA_JUNKED)) {
 	    freehistnode((HashNode)hist_ring);
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---



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