about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2001-09-13 18:19:08 +0000
committerWayne Davison <wayned@users.sourceforge.net>2001-09-13 18:19:08 +0000
commit6a7d256a5806dbf6287f34efd4a98369c56026cb (patch)
treeedd3ea3af9c00c3b33782ee529cdee35e236f2b8 /Src
parent67ef2a91df1af236f244beb282081f920f15969e (diff)
downloadzsh-6a7d256a5806dbf6287f34efd4a98369c56026cb.tar.gz
zsh-6a7d256a5806dbf6287f34efd4a98369c56026cb.tar.xz
zsh-6a7d256a5806dbf6287f34efd4a98369c56026cb.zip
+ Changed fclist() to not not transform "fc -l 0 0" into "fc -l 1 1".
+ Changed fcgetcomm() to handle new error return from addhistnum().
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 388a94643..083e50f95 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1299,8 +1299,8 @@ bin_fc(char *nam, char **argv, char *ops, int func)
     if (last == -1)
 	last = ops['l']? addhistnum(curline.histnum,-1,0) : first;
     if (first < firsthist())
-	first = firsthist();
-    if (last == -1)
+	first = firsthist() - (first == last);
+    if (last > curhist)
 	last = (minflag) ? curhist : first;
     else if (last < first)
 	last = first;
@@ -1368,7 +1368,7 @@ fcgetcomm(char *s)
     if ((cmd = atoi(s))) {
 	if (cmd < 0)
 	    cmd = addhistnum(curline.histnum,cmd,HIST_FOREIGN);
-	if (cmd >= curline.histnum) {
+	if (cmd < firsthist()) {
 	    zwarnnam("fc", "bad history number: %d", 0, cmd);
 	    return -1;
 	}