summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-10-01 08:43:58 +0000
committerobrien <obrien@FreeBSD.org>2001-10-01 08:43:58 +0000
commitd9494059c0831aec86c9b2ccc7c0dbb40f70615f (patch)
tree9059e56ae23cbabd5e6903995dcb45dc73d47b83 /usr.sbin
parent90300f853673b3879ab4d6a60683ff69b564c58b (diff)
downloadFreeBSD-src-d9494059c0831aec86c9b2ccc7c0dbb40f70615f.zip
FreeBSD-src-d9494059c0831aec86c9b2ccc7c0dbb40f70615f.tar.gz
*** empty log message ***
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/cdcontrol/cdcontrol.c8
-rw-r--r--usr.sbin/lpr/lpc/lpc.c7
-rw-r--r--usr.sbin/pppctl/pppctl.c18
3 files changed, 18 insertions, 15 deletions
diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c
index e8ab6c7..3e272d3 100644
--- a/usr.sbin/cdcontrol/cdcontrol.c
+++ b/usr.sbin/cdcontrol/cdcontrol.c
@@ -1098,6 +1098,7 @@ input (int *cmd)
#define MAXLINE 80
static EditLine *el = NULL;
static History *hist = NULL;
+ HistEvent he;
static char buf[MAXLINE];
int num = 0;
int len;
@@ -1107,9 +1108,10 @@ input (int *cmd)
do {
if (verbose) {
if (!el) {
- el = el_init("cdcontrol", stdin, stdout);
+ el = el_init("cdcontrol", stdin, stdout,
+ stderr);
hist = history_init();
- history(hist, H_EVENT, 100);
+ history(hist, &he, H_EVENT, 100);
el_set(el, EL_HIST, history, hist);
el_set(el, EL_EDITOR, "emacs");
el_set(el, EL_PROMPT, cdcontrol_prompt);
@@ -1125,7 +1127,7 @@ input (int *cmd)
len = (num > MAXLINE) ? MAXLINE : num;
memcpy(buf, bp, len);
buf[len] = 0;
- history(hist, H_ENTER, bp);
+ history(hist, &he, H_ENTER, bp);
#undef MAXLINE
} else {
diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c
index 5c890f4..457ad70 100644
--- a/usr.sbin/lpr/lpc/lpc.c
+++ b/usr.sbin/lpr/lpc/lpc.c
@@ -150,6 +150,7 @@ cmdscanner(void)
register struct cmd *c;
static EditLine *el;
static History *hist;
+ HistEvent he;
size_t len;
int num;
const char *bp;
@@ -161,9 +162,9 @@ cmdscanner(void)
for (;;) {
if (fromatty) {
if (!el) {
- el = el_init("lpc", stdin, stdout);
+ el = el_init("lpc", stdin, stdout, stderr);
hist = history_init();
- history(hist, H_EVENT, 100);
+ history(hist, &he, H_EVENT, 100);
el_set(el, EL_HIST, history, hist);
el_set(el, EL_EDITOR, "emacs");
el_set(el, EL_PROMPT, lpc_prompt);
@@ -185,7 +186,7 @@ cmdscanner(void)
len = (num > MAX_CMDLINE) ? MAX_CMDLINE : num;
memcpy(cmdline, bp, len);
cmdline[len] = 0;
- history(hist, H_ENTER, bp);
+ history(hist, &he, H_ENTER, bp);
} else {
if (fgets(cmdline, MAX_CMDLINE, stdin) == 0)
diff --git a/usr.sbin/pppctl/pppctl.c b/usr.sbin/pppctl/pppctl.c
index be9b73c..a83354d 100644
--- a/usr.sbin/pppctl/pppctl.c
+++ b/usr.sbin/pppctl/pppctl.c
@@ -273,7 +273,7 @@ Terminal(void *v)
struct thread_data *td;
const char *l;
int len;
-#ifdef __NetBSD__
+#ifndef __OpenBSD__
HistEvent hev = { 0, "" };
#endif
@@ -287,10 +287,10 @@ Terminal(void *v)
while ((l = SmartGets(td->edit, &len, td->ppp))) {
if (len > 1)
-#ifdef __NetBSD__
- history(td->hist, &hev, H_ENTER, l);
-#else
+#ifdef __OpenBSD__
history(td->hist, H_ENTER, l);
+#else
+ history(td->hist, &hev, H_ENTER, l);
#endif
write(td->ppp, l, len);
if (Receive(td->ppp, REC_SHOW) != 0)
@@ -543,7 +543,7 @@ main(int argc, char **argv)
struct thread_data td;
const char *env;
int size;
-#ifdef __NetBSD__
+#ifndef __OpenBSD__
HistEvent hev = { 0, "" };
#endif
@@ -554,12 +554,12 @@ main(int argc, char **argv)
size = 20;
} else
size = 20;
-#ifdef __NetBSD__
- history(td.hist, &hev, H_SETSIZE, size);
- td.edit = el_init("pppctl", stdin, stdout, stderr);
-#else
+#ifdef __OpenBSD__
history(td.hist, H_EVENT, size);
td.edit = el_init("pppctl", stdin, stdout);
+#else
+ history(td.hist, &hev, H_SETSIZE, size);
+ td.edit = el_init("pppctl", stdin, stdout, stderr);
#endif
el_source(td.edit, NULL);
el_set(td.edit, EL_PROMPT, GetPrompt);
OpenPOWER on IntegriCloud