aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pppctl
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-04-26 08:53:52 +0000
committerBrian Somers <brian@FreeBSD.org>1999-04-26 08:53:52 +0000
commitb941043fa25b710f75e25cd38dbfe24d4bb04e68 (patch)
tree14fb7d4e8244c2668865f7ce89b6d185e86b0433 /usr.sbin/pppctl
parente773ff25b76d09d682730caa1eab7ca140c9d73d (diff)
downloadsrc-b941043fa25b710f75e25cd38dbfe24d4bb04e68.tar.gz
src-b941043fa25b710f75e25cd38dbfe24d4bb04e68.zip
Add support for NetBSD (history() from libedit is different).
Notes
Notes: svn path=/head/; revision=46084
Diffstat (limited to 'usr.sbin/pppctl')
-rw-r--r--usr.sbin/pppctl/pppctl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/pppctl/pppctl.c b/usr.sbin/pppctl/pppctl.c
index 83ee6701db9d..b93e091c82fc 100644
--- a/usr.sbin/pppctl/pppctl.c
+++ b/usr.sbin/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.16 1998/03/22 00:43:04 brian Exp $
+ * $Id: pppctl.c,v 1.17 1999/01/31 12:24:29 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;