diff options
author | Wayne Davison <wayned@users.sourceforge.net> | 2000-07-18 07:56:45 +0000 |
---|---|---|
committer | Wayne Davison <wayned@users.sourceforge.net> | 2000-07-18 07:56:45 +0000 |
commit | b50d75490992dd00ab0f256d0449e2c53c193637 (patch) | |
tree | e37dabb6e16c8244cf6ad2ee151e68edcbbcce84 /Src | |
parent | b4c5de44f991022843f3a2f100240bc34ee77d88 (diff) | |
download | zsh-b50d75490992dd00ab0f256d0449e2c53c193637.tar.gz zsh-b50d75490992dd00ab0f256d0449e2c53c193637.tar.xz zsh-b50d75490992dd00ab0f256d0449e2c53c193637.zip |
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.
Diffstat (limited to 'Src')
-rw-r--r-- | Src/builtin.c | 12 |
1 files changed, 7 insertions, 5 deletions
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; } |