summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/pppctl
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1999-04-26 08:53:34 +0000
committerbrian <brian@cvs.openbsd.org>1999-04-26 08:53:34 +0000
commit5bae9f98baad73768fdd86a6b10cd414f5bf7cbe (patch)
tree2bc47c70422fea818865236cddf16631fa4720a3 /usr.sbin/ppp/pppctl
parent476519eb5ac732d33d2b60e1aa3c36e5b9127707 (diff)
Add support for NetBSD (history() from libedit is different).
Diffstat (limited to 'usr.sbin/ppp/pppctl')
-rw-r--r--usr.sbin/ppp/pppctl/pppctl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/ppp/pppctl/pppctl.c b/usr.sbin/ppp/pppctl/pppctl.c
index d903ffb76fd..a51c309d3fe 100644
--- a/usr.sbin/ppp/pppctl/pppctl.c
+++ b/usr.sbin/ppp/pppctl/pppctl.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pppctl.c,v 1.2 1999/01/31 12:25:04 brian Exp $
+ * $Id: pppctl.c,v 1.3 1999/04/26 08:53:33 brian Exp $
*/
#include <sys/types.h>
@@ -365,8 +365,11 @@ main(int argc, char **argv)
size = 20;
} else
size = 20;
+#ifdef __NetBSD__
+ history(hist, NULL, H_SETSIZE, size);
+#else
history(hist, H_EVENT, size);
-
+#endif
edit = el_init("pppctl", stdin, stdout);
el_source(edit, NULL);
el_set(edit, EL_PROMPT, GetPrompt);
@@ -380,7 +383,11 @@ main(int argc, char **argv)
el_set(edit, EL_HIST, history, (const char *)hist);
while ((l = smartgets(edit, &len, fd))) {
if (len > 1)
+#ifdef __NetBSD__
+ history(hist, NULL, H_ENTER, l);
+#else
history(hist, H_ENTER, l);
+#endif
write(fd, l, len);
if (Receive(fd, REC_SHOW) != 0)
break;