projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add ``history -h >file'' and ``source -h file'' to
[unix-history]
/
usr
/
src
/
bin
/
csh
/
hist.c
diff --git
a/usr/src/bin/csh/hist.c
b/usr/src/bin/csh/hist.c
index
881b9e6
..
5d8a379
100644
(file)
--- a/
usr/src/bin/csh/hist.c
+++ b/
usr/src/bin/csh/hist.c
@@
-69,16
+69,15
@@
hfree(hp)
dohist(vp)
char **vp;
{
dohist(vp)
char **vp;
{
- int n, rflg = 0, cflg = 0;
-
+ int n, rflg = 0, hflg = 0;
if (getn(value("history")) == 0)
return;
if (setintr)
sigrelse(SIGINT);
vp++;
while (*vp[0] == '-') {
if (getn(value("history")) == 0)
return;
if (setintr)
sigrelse(SIGINT);
vp++;
while (*vp[0] == '-') {
- if (*vp && eq(*vp, "-
c
")) {
-
c
flg++;
+ if (*vp && eq(*vp, "-
h
")) {
+
h
flg++;
vp++;
}
if (*vp && eq(*vp, "-r")) {
vp++;
}
if (*vp && eq(*vp, "-r")) {
@@
-88,14
+87,15
@@
dohist(vp)
}
if (*vp)
n = getn(*vp);
}
if (*vp)
n = getn(*vp);
- else
- n = 1000;
- dohist1(Histlist.Hnext, &n, rflg, cflg);
+ else {
+ n = getn(value("history"));
+ }
+ dohist1(Histlist.Hnext, &n, rflg, hflg);
}
}
-dohist1(hp, np, rflg,
c
flg)
+dohist1(hp, np, rflg,
h
flg)
struct Hist *hp;
struct Hist *hp;
- int *np;
+ int *np
, rflg, hflg
;
{
bool print = (*np) > 0;
top:
{
bool print = (*np) > 0;
top:
@@
-104,23
+104,23
@@
top:
(*np)--;
hp->Href++;
if (rflg == 0) {
(*np)--;
hp->Href++;
if (rflg == 0) {
- dohist1(hp->Hnext, np, rflg,
c
flg);
+ dohist1(hp->Hnext, np, rflg,
h
flg);
if (print)
if (print)
- phist(hp,
c
flg);
+ phist(hp,
h
flg);
return;
}
if (*np >= 0)
return;
}
if (*np >= 0)
- phist(hp,
c
flg);
+ phist(hp,
h
flg);
hp = hp->Hnext;
goto top;
}
hp = hp->Hnext;
goto top;
}
-phist(hp,
c
flg)
+phist(hp,
h
flg)
register struct Hist *hp;
register struct Hist *hp;
- int
c
flg;
+ int
h
flg;
{
{
- if (
c
flg == 0)
+ if (
h
flg == 0)
printf("%6d\t", hp->Hnum);
prlex(&hp->Hlex);
}
printf("%6d\t", hp->Hnum);
prlex(&hp->Hlex);
}