diff options
| author | Wayne Davison <wayned@users.sourceforge.net> | 2002-04-17 10:17:48 +0000 |
|---|---|---|
| committer | Wayne Davison <wayned@users.sourceforge.net> | 2002-04-17 10:17:48 +0000 |
| commit | 916dd5968d4a51cd595e8d8b36f8c621624ea68e (patch) | |
| tree | c3d64db6d006973548b6a4463f705b16f7197c70 /Src | |
| parent | 16890 (diff) | |
| download | zsh-916dd5968d4a51cd595e8d8b36f8c621624ea68e.tar zsh-916dd5968d4a51cd595e8d8b36f8c621624ea68e.tar.gz zsh-916dd5968d4a51cd595e8d8b36f8c621624ea68e.tar.bz2 zsh-916dd5968d4a51cd595e8d8b36f8c621624ea68e.tar.lz zsh-916dd5968d4a51cd595e8d8b36f8c621624ea68e.tar.xz zsh-916dd5968d4a51cd595e8d8b36f8c621624ea68e.tar.zst zsh-916dd5968d4a51cd595e8d8b36f8c621624ea68e.zip | |
16703-B
Diffstat (limited to 'Src')
| -rw-r--r-- | Src/builtin.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Src/builtin.c b/Src/builtin.c index b51f61e27..c2e087706 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -1293,18 +1293,23 @@ bin_fc(char *nam, char **argv, char *ops, int func) return 1; } /* default values of first and last, and range checking */ + if (last == -1) { + if (ops['l'] && first < curhist) { + last = addhistnum(curline.histnum,-1,0); + if (last < firsthist()) + last = firsthist(); + } + else + last = first; + } if (first == -1) { first = ops['l']? addhistnum(curline.histnum,-16,0) - : addhistnum(curline.histnum,-1,0); + : addhistnum(curline.histnum,-1,0); + if (first < 1) + first = 1; + if (last < first) + last = first; } - if (last == -1) - last = ops['l']? addhistnum(curline.histnum,-1,0) : first; - if (first < firsthist()) - first = firsthist() - (last < firsthist()); - if (last > curhist) - last = curhist; - else if (last < first) - last = first; if (ops['l']) { /* list the required part of the history */ retval = fclist(stdout, !ops['n'], ops['r'], ops['D'], |
