about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2001-09-15 06:28:15 +0000
committerWayne Davison <wayned@users.sourceforge.net>2001-09-15 06:28:15 +0000
commit2a754dbb61c66ff51ae1a64fc678c3023aa31649 (patch)
treee4962bf40907abc8bfbde40076332109388caa60
parent349236b7fdc7ad1d9311e3465bebbd8c430772d8 (diff)
downloadzsh-2a754dbb61c66ff51ae1a64fc678c3023aa31649.tar.gz
zsh-2a754dbb61c66ff51ae1a64fc678c3023aa31649.tar.xz
zsh-2a754dbb61c66ff51ae1a64fc678c3023aa31649.zip
With HIST_NO_STORE, don't ignore what looks like a history command if
we're really going to call a user-defined shell function.
-rw-r--r--Src/hist.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Src/hist.c b/Src/hist.c
index 329e988a7..6b254a3db 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -989,14 +989,20 @@ should_ignore_line(Eprog prog)
 
     if (isset(HISTNOSTORE)) {
 	char *b = getjobtext(prog, NULL);
-	if (*b == 'b' && strncmp(b, "builtin ", 8) == 0)
+	int saw_builtin;
+	if (*b == 'b' && strncmp(b,"builtin ",8) == 0) {
 	    b += 8;
-	if (*b == 'h' && strncmp(b, "history", 7) == 0
-	 && (!b[7] || b[7] == ' '))
+	    saw_builtin = 1;
+	} else
+	    saw_builtin = 0;
+	if (*b == 'h' && strncmp(b,"history",7) == 0 && (!b[7] || b[7] == ' ')
+	 && (saw_builtin || !shfunctab->getnode(shfunctab,"history")))
 	    return 1;
-	if (*b == 'r' && (!b[1] || b[1] == ' '))
+	if (*b == 'r' && (!b[1] || b[1] == ' ')
+	 && (saw_builtin || !shfunctab->getnode(shfunctab,"r")))
 	    return 1;
-	if (*b == 'f' && b[1] == 'c' && b[2] == ' ' && b[3] == '-') {
+	if (*b == 'f' && b[1] == 'c' && b[2] == ' ' && b[3] == '-'
+	 && (saw_builtin || !shfunctab->getnode(shfunctab,"fc"))) {
 	    b += 3;
 	    do {
 		if (*++b == 'l')