From 2a754dbb61c66ff51ae1a64fc678c3023aa31649 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 15 Sep 2001 06:28:15 +0000 Subject: 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. --- Src/hist.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Src/hist.c') 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') -- cgit 1.4.1