about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2001-09-13 18:19:11 +0000
committerWayne Davison <wayned@users.sourceforge.net>2001-09-13 18:19:11 +0000
commitfc89b8135a73fe02ea72b3b4ded24367be50109b (patch)
tree1022caf03cdf0153c881cdab01a07728d6ab8f1b
parent6a7d256a5806dbf6287f34efd4a98369c56026cb (diff)
downloadzsh-fc89b8135a73fe02ea72b3b4ded24367be50109b.tar.gz
zsh-fc89b8135a73fe02ea72b3b4ded24367be50109b.tar.xz
zsh-fc89b8135a73fe02ea72b3b4ded24367be50109b.zip
+ Changed addhistnum() to return firsthist()-1 or curhist+1 on error.
+ Ignore the "r" command if HIST_NO_STORE is set.
-rw-r--r--Src/hist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/hist.c b/Src/hist.c
index a37b230b0..329e988a7 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;
 }
 
@@ -994,6 +994,8 @@ should_ignore_line(Eprog prog)
 	if (*b == 'h' && strncmp(b, "history", 7) == 0
 	 && (!b[7] || b[7] == ' '))
 	    return 1;
+	if (*b == 'r' && (!b[1] || b[1] == ' '))
+	    return 1;
 	if (*b == 'f' && b[1] == 'c' && b[2] == ' ' && b[3] == '-') {
 	    b += 3;
 	    do {