zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: HIST_NO_STORE supports "builtin"
@ 2000-07-20  7:06 Wayne Davison
  0 siblings, 0 replies; only message in thread
From: Wayne Davison @ 2000-07-20  7:06 UTC (permalink / raw)
  To: Zsh Workers

I noticed that my latest HIST_NO_STORE support wouldn't work if you
ran "builtin history" rather than just "history".  This fixes that,
but I didn't bother to worry about things like "noglob" or anything
else.

If anyone knows of a better way to do this matching (like maybe
compiling a pattern or something) please let me know.  I looked at the
underlying list data that the lexer generated, and it didn't look to
be useful for this test (unlike the HIST_NO_FUNCTIONS support, where
it was very useful).

..wayne..

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: Src/hist.c
@@ -965,21 +965,24 @@
 
     if (isset(HISTNOSTORE)) {
 	char *b = getpermtext(prog, NULL);
+	char *t = b;
+	if (*b == 'b' && strncmp(b, "builtin ", 8) == 0)
+	    b += 8;
 	if (*b == 'h' && strncmp(b, "history", 7) == 0
 	 && (!b[7] || b[7] == ' ')) {
-	    zsfree(b);
+	    zsfree(t);
 	    return 1;
 	}
 	if (*b == 'f' && b[1] == 'c' && b[2] == ' ' && b[3] == '-') {
 	    b += 3;
 	    do {
 		if (*++b == 'l') {
-		    zsfree(b);
+		    zsfree(t);
 		    return 1;
 		}
 	    } while (isalpha(*b));
 	}
-	zsfree(b);
+	zsfree(t);
     }
 
     return 0;
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-07-20  7:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-20  7:06 PATCH: HIST_NO_STORE supports "builtin" Wayne Davison

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).