From b50d75490992dd00ab0f256d0449e2c53c193637 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 18 Jul 2000 07:56:45 +0000 Subject: Changed several references to curhist into curline.histnum so that they would work right even if we didn't store the current command in the history. --- Src/builtin.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Src') diff --git a/Src/builtin.c b/Src/builtin.c index 7f8e90741..6b5ca4e8e 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -1247,10 +1247,12 @@ bin_fc(char *nam, char **argv, char *ops, int func) return 1; } /* default values of first and last, and range checking */ - if (first == -1) - first = ops['l']? addhistnum(curhist,-16,0) : addhistnum(curhist,-1,0); + if (first == -1) { + first = ops['l']? addhistnum(curline.histnum,-16,0) + : addhistnum(curline.histnum,-1,0); + } if (last == -1) - last = ops['l']? addhistnum(curhist,-1,0) : first; + last = ops['l']? addhistnum(curline.histnum,-1,0) : first; if (first < firsthist()) first = firsthist(); if (last == -1) @@ -1315,8 +1317,8 @@ fcgetcomm(char *s) * numbers indicate reversed numbering. */ if ((cmd = atoi(s))) { if (cmd < 0) - cmd = addhistnum(curhist,cmd,HIST_FOREIGN); - if (cmd >= curhist) { + cmd = addhistnum(curline.histnum,cmd,HIST_FOREIGN); + if (cmd >= curline.histnum) { zwarnnam("fc", "bad history number: %d", 0, cmd); return -1; } -- cgit 1.4.1