summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2001-10-13 21:33:28 +0000
committerWayne Davison <wayned@users.sourceforge.net>2001-10-13 21:33:28 +0000
commit66fbad4372d9b33db6529e40fabb6813f7ec21da (patch)
treee735877d14bc5249cd6f4f757b7a7320b6d0866a
parentSeparated my one combo-changelog entry into its original two items (diff)
downloadzsh-66fbad4372d9b33db6529e40fabb6813f7ec21da.tar
zsh-66fbad4372d9b33db6529e40fabb6813f7ec21da.tar.gz
zsh-66fbad4372d9b33db6529e40fabb6813f7ec21da.tar.bz2
zsh-66fbad4372d9b33db6529e40fabb6813f7ec21da.tar.lz
zsh-66fbad4372d9b33db6529e40fabb6813f7ec21da.tar.xz
zsh-66fbad4372d9b33db6529e40fabb6813f7ec21da.tar.zst
zsh-66fbad4372d9b33db6529e40fabb6813f7ec21da.zip
Brought over 15806 and 15809 from the trunk.
-rw-r--r--Src/hist.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/Src/hist.c b/Src/hist.c
index 0966351c7..6ce3651dc 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -845,7 +845,7 @@ addhistnum(int hl, int n, int xflags)
if (n)
he = movehistent(he, n, xflags);
if (!he)
- return dir < 0? firsthist() : curhist;
+ return dir < 0? firsthist() - 1 : curhist + 1;
return he->histnum;
}
@@ -989,12 +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] == ' ')
+ && (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')