From 6a7d256a5806dbf6287f34efd4a98369c56026cb Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 13 Sep 2001 18:19:08 +0000 Subject: + Changed fclist() to not not transform "fc -l 0 0" into "fc -l 1 1". + Changed fcgetcomm() to handle new error return from addhistnum(). --- Src/builtin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Src/builtin.c') 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; } -- cgit 1.4.1