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

Re: Bug with hist_ignore_space



On Fri, 12 Oct 2001, Geoff Wing wrote:
> what's up with hist_ignore_space at the moment?  Commands
> with spaces at the start are staying in history past the
> one more command limit and are also being written to HISTFILE

Only interactive comments were doing this.  Turns out that a comment
has its Eprog set to NULL, and should_ignore_line() didn't realize
that this could still represent something it needed to check.  Here's
the patch.

..wayne..

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: Src/hist.c
--- Src/hist.c	2001/09/24 15:15:08	1.34
+++ Src/hist.c	2001/10/15 18:34:04
@@ -971,13 +971,13 @@
 static int
 should_ignore_line(Eprog prog)
 {
-    if (!prog)
-	return 0;
-
     if (isset(HISTIGNORESPACE)) {
 	if (*chline == ' ' || aliasspaceflag)
 	    return 1;
     }
+
+    if (!prog)
+	return 0;
 
     if (isset(HISTNOFUNCTIONS)) {
 	Wordcode pc = prog->prog;
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---



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