about summary refs log tree commit diff
diff options
context:
space:
mode:
-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')