zsh-workers
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: Zsh Workers <zsh-workers@sunsite.auc.dk>
Subject: PATCH: HIST_NO_STORE supports "builtin"
Date: Thu, 20 Jul 2000 00:06:03 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.21.0007200000190.27265-100000@phong.blorf.net> (raw)

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---


                 reply	other threads:[~2000-07-20  7:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.21.0007200000190.27265-100000@phong.blorf.net \
    --to=wayned@users.sourceforge.net \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).