summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-01-16 05:18:56 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-01-16 05:18:56 +0000
commitd811c9277c942ef81ec5f325ae55337ff3089842 (patch)
treeaf13e7c0dcb8d4e9d9d938bce60eb610f8bb6748
parent891d48fc5656bed485ad5e2b5e154786b9f84d2e (diff)
Merge in NetBSD libedit changes and new man pages. Also fix some
strncpy() usage in their code. NetBSD change log was: * add a man page for the editline routines * add a man page describing editrc * fix bugs in el_parse(): * didn't execute command when program name matched (test reversed) * was checking against empty string instead of program name * after checks, command to run also pointed to empty string * document ^char and \ escape sequences * when parsing ^char control chars, check the correct char when determining validity (previously, ^char was a NOP interpreted as the literal string because of this bug) * Implement CC_REDISPLAY, which (unlike CC_REFRESH) redraws the entire input * line (a la ^R). This is useful if the binding outputs information and * mucks up the input line. To be used in ``list-choices'' bindings (refer * to the ^D binding in csh when filec is set)
-rw-r--r--lib/libedit/Makefile12
-rw-r--r--lib/libedit/TEST/test.c6
-rw-r--r--lib/libedit/chared.c6
-rw-r--r--lib/libedit/chared.h2
-rw-r--r--lib/libedit/common.c16
-rw-r--r--lib/libedit/el.c13
-rw-r--r--lib/libedit/el.h2
-rw-r--r--lib/libedit/emacs.c6
-rw-r--r--lib/libedit/hist.c12
-rw-r--r--lib/libedit/hist.h2
-rw-r--r--lib/libedit/histedit.h3
-rw-r--r--lib/libedit/history.c6
-rw-r--r--lib/libedit/key.c6
-rw-r--r--lib/libedit/key.h2
-rw-r--r--lib/libedit/makelist1
-rw-r--r--lib/libedit/map.c6
-rw-r--r--lib/libedit/map.h2
-rw-r--r--lib/libedit/parse.c24
-rw-r--r--lib/libedit/parse.h2
-rw-r--r--lib/libedit/prompt.c6
-rw-r--r--lib/libedit/prompt.h2
-rw-r--r--lib/libedit/read.c13
-rw-r--r--lib/libedit/refresh.c6
-rw-r--r--lib/libedit/refresh.h2
-rw-r--r--lib/libedit/search.c9
-rw-r--r--lib/libedit/search.h2
-rw-r--r--lib/libedit/sig.c6
-rw-r--r--lib/libedit/sig.h2
-rw-r--r--lib/libedit/sys.h2
-rw-r--r--lib/libedit/term.c7
-rw-r--r--lib/libedit/term.h2
-rw-r--r--lib/libedit/termcap.h2
-rw-r--r--lib/libedit/tokenizer.c6
-rw-r--r--lib/libedit/tokenizer.h2
-rw-r--r--lib/libedit/tty.c6
-rw-r--r--lib/libedit/tty.h2
-rw-r--r--lib/libedit/vi.c6
37 files changed, 191 insertions, 21 deletions
diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile
index c990dffaca0..18ba3406249 100644
--- a/lib/libedit/Makefile
+++ b/lib/libedit/Makefile
@@ -1,4 +1,5 @@
-# @(#)Makefile 8.1 (Berkeley) 6/4/93
+# $OpenBSD: Makefile,v 1.4 1997/01/16 05:18:27 millert Exp $
+# from: @(#)Makefile 8.1 (Berkeley) 6/4/93
LIB= edit
@@ -6,6 +7,15 @@ OSRCS= chared.c common.c el.c emacs.c hist.c key.c map.c parse.c \
prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c \
help.c fcns.c
+MAN= editline.3 editrc.5
+
+MLINKS= editline.3 el_init.3 editline.3 el_end.3 editline.3 el_reset.3 \
+ editline.3 el_gets.3 editline.3 el_getc.3 editline.3 el_push.3 \
+ editline.3 el_parse.3 editline.3 el_set.3 editline.3 el_source.3 \
+ editline.3 el_resize.3 editline.3 el_line.3 \
+ editline.3 el_insertstr.3 editline.3 el_deletestr.3 \
+ editline.3 history_init.3 editline.3 history_end.3 editline.3 history.3
+
# For speed and debugging
#SRCS= ${OSRCS} tokenizer.c history.c
# For protection
diff --git a/lib/libedit/TEST/test.c b/lib/libedit/TEST/test.c
index f0ae4ebc97e..646b2355194 100644
--- a/lib/libedit/TEST/test.c
+++ b/lib/libedit/TEST/test.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: test.c,v 1.3 1997/01/16 05:18:55 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -41,7 +43,11 @@ static char copyright[] =
#endif /* not lint */
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: test.c,v 1.3 1997/01/16 05:18:55 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
diff --git a/lib/libedit/chared.c b/lib/libedit/chared.c
index 5a393a76248..4498c67c82b 100644
--- a/lib/libedit/chared.c
+++ b/lib/libedit/chared.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: chared.c,v 1.2 1997/01/16 05:18:28 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: chared.c,v 1.2 1997/01/16 05:18:28 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
diff --git a/lib/libedit/chared.h b/lib/libedit/chared.h
index 20da6c87a6d..47b11af3f0b 100644
--- a/lib/libedit/chared.h
+++ b/lib/libedit/chared.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: chared.h,v 1.2 1997/01/16 05:18:29 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/common.c b/lib/libedit/common.c
index 696da528e51..9131b58f54e 100644
--- a/lib/libedit/common.c
+++ b/lib/libedit/common.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: common.c,v 1.2 1997/01/16 05:18:30 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: common.c,v 1.2 1997/01/16 05:18:30 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
@@ -651,9 +657,7 @@ ed_redisplay(el, c)
EditLine *el;
int c;
{
- re_clear_lines(el);
- re_clear_display(el);
- return CC_REFRESH;
+ return CC_REDISPLAY;
}
@@ -702,7 +706,8 @@ ed_prev_history(el, c)
*el->el_line.lastchar = '\0'; /* just in case */
if (el->el_history.eventno == 0) { /* save the current buffer away */
- (void) strncpy(el->el_history.buf, el->el_line.buffer, EL_BUFSIZ);
+ (void) strncpy(el->el_history.buf, el->el_line.buffer, EL_BUFSIZ - 1);
+ el->el_history.buf[EL_BUFSIZ - 1] = '\0';
el->el_history.last = el->el_history.buf +
(el->el_line.lastchar - el->el_line.buffer);
}
@@ -773,7 +778,8 @@ ed_search_prev_history(el, c)
}
if (el->el_history.eventno == 0) {
- (void) strncpy(el->el_history.buf, el->el_line.buffer, EL_BUFSIZ);
+ (void) strncpy(el->el_history.buf, el->el_line.buffer, EL_BUFSIZ - 1);
+ el->el_history.buf[EL_BUFSIZ - 1] = '\0';
el->el_history.last = el->el_history.buf +
(el->el_line.lastchar - el->el_line.buffer);
}
diff --git a/lib/libedit/el.c b/lib/libedit/el.c
index 6b7b5d49bc4..87bce35a04e 100644
--- a/lib/libedit/el.c
+++ b/lib/libedit/el.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: el.c,v 1.4 1997/01/16 05:18:31 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
+#else
+static char rcsid[] = "$OpenBSD: el.c,v 1.4 1997/01/16 05:18:31 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
@@ -52,6 +58,7 @@ static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
#else
# include <varargs.h>
#endif
+#include <unistd.h>
#include "el.h"
/* el_init():
@@ -293,9 +300,9 @@ el_source(el, fname)
if ((fp = fopen(fname, "r")) == NULL) {
if (issetugid() != 0 || (ptr = getenv("HOME")) == NULL)
return -1;
- fname = strncpy(path, ptr, MAXPATHLEN);
- path[MAXPATHLEN-1] = '\0';
- (void) strncat(path, elpath, MAXPATHLEN - strlen(path));
+ fname = strncpy(path, ptr, sizeof(path) - 1);
+ path[sizeof(path) - 1] = '\0';
+ (void) strncat(path, elpath, sizeof(path) - strlen(path));
}
}
diff --git a/lib/libedit/el.h b/lib/libedit/el.h
index 77cce15a3d4..c2f0fbb5086 100644
--- a/lib/libedit/el.h
+++ b/lib/libedit/el.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: el.h,v 1.2 1997/01/16 05:18:32 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/emacs.c b/lib/libedit/emacs.c
index 273de1079f7..c921bdbdd09 100644
--- a/lib/libedit/emacs.c
+++ b/lib/libedit/emacs.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: emacs.c,v 1.2 1997/01/16 05:18:32 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)emacs.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: emacs.c,v 1.2 1997/01/16 05:18:32 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
diff --git a/lib/libedit/hist.c b/lib/libedit/hist.c
index 394df63e9d3..b9a6e20c677 100644
--- a/lib/libedit/hist.c
+++ b/lib/libedit/hist.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: hist.c,v 1.2 1997/01/16 05:18:33 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: hist.c,v 1.2 1997/01/16 05:18:33 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
@@ -100,7 +106,8 @@ hist_get(el)
int h;
if (el->el_history.eventno == 0) { /* if really the current line */
- (void) strncpy(el->el_line.buffer, el->el_history.buf, EL_BUFSIZ);
+ (void) strncpy(el->el_line.buffer, el->el_history.buf, EL_BUFSIZ - 1);
+ el->el_line.buffer[EL_BUFSIZ - 1] = '\0';
el->el_line.lastchar = el->el_line.buffer +
(el->el_history.last - el->el_history.buf);
@@ -128,7 +135,8 @@ hist_get(el)
return CC_ERROR;
}
- (void) strncpy(el->el_line.buffer, hp, EL_BUFSIZ);
+ (void) strncpy(el->el_line.buffer, hp, EL_BUFSIZ - 1);
+ el->el_line.buffer[EL_BUFSIZ - 1] = '\0';
el->el_line.lastchar = el->el_line.buffer + strlen(el->el_line.buffer);
if (el->el_line.lastchar > el->el_line.buffer) {
diff --git a/lib/libedit/hist.h b/lib/libedit/hist.h
index dff3968fd1f..57319686ba2 100644
--- a/lib/libedit/hist.h
+++ b/lib/libedit/hist.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: hist.h,v 1.3 1997/01/16 05:18:34 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/histedit.h b/lib/libedit/histedit.h
index d3c32cc5b63..ee88d54ec3b 100644
--- a/lib/libedit/histedit.h
+++ b/lib/libedit/histedit.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: histedit.h,v 1.3 1997/01/16 05:18:34 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -72,6 +74,7 @@ typedef struct lineinfo {
#define CC_CURSOR 5
#define CC_ERROR 6
#define CC_FATAL 7
+#define CC_REDISPLAY 8
/*
* Initialization, cleanup, and resetting
diff --git a/lib/libedit/history.c b/lib/libedit/history.c
index 9594207a840..cddeea185d4 100644
--- a/lib/libedit/history.c
+++ b/lib/libedit/history.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: history.c,v 1.3 1997/01/16 05:18:35 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)history.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: history.c,v 1.3 1997/01/16 05:18:35 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
diff --git a/lib/libedit/key.c b/lib/libedit/key.c
index 058da0e7f43..2fd5703d0a6 100644
--- a/lib/libedit/key.c
+++ b/lib/libedit/key.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: key.c,v 1.2 1997/01/16 05:18:36 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: key.c,v 1.2 1997/01/16 05:18:36 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
diff --git a/lib/libedit/key.h b/lib/libedit/key.h
index 2ed3afc8fe0..5dfb3316f7e 100644
--- a/lib/libedit/key.h
+++ b/lib/libedit/key.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: key.h,v 1.2 1997/01/16 05:18:36 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/makelist b/lib/libedit/makelist
index 7c4bebc6862..b2b320e89a1 100644
--- a/lib/libedit/makelist
+++ b/lib/libedit/makelist
@@ -1,4 +1,5 @@
#!/bin/sh -
+# $OpenBSD: makelist,v 1.2 1997/01/16 05:18:37 millert Exp $
#
# Copyright (c) 1992, 1993
# The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/map.c b/lib/libedit/map.c
index db26f990eda..c760cedb9fb 100644
--- a/lib/libedit/map.c
+++ b/lib/libedit/map.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: map.c,v 1.2 1997/01/16 05:18:38 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: map.c,v 1.2 1997/01/16 05:18:38 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
diff --git a/lib/libedit/map.h b/lib/libedit/map.h
index 71c93b4a21e..89743ded206 100644
--- a/lib/libedit/map.h
+++ b/lib/libedit/map.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: map.h,v 1.2 1997/01/16 05:18:39 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/parse.c b/lib/libedit/parse.c
index 2fe746f370b..b88f74e8d30 100644
--- a/lib/libedit/parse.c
+++ b/lib/libedit/parse.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: parse.c,v 1.2 1997/01/16 05:18:39 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: parse.c,v 1.2 1997/01/16 05:18:39 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
@@ -45,8 +51,10 @@ static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
*
* bind
* echotc
- * settc
* gettc
+ * history
+ * settc
+ * setty
*/
#include "sys.h"
#include "el.h"
@@ -97,12 +105,12 @@ el_parse(el, argc, argv)
char *ptr;
int i;
- for (ptr = argv[0]; *ptr && *ptr != ':'; ptr++)
- continue;
-
- if (*ptr == ':') {
- *ptr = '\0';
- if (el_match(el->el_prog, ptr))
+ if (argc < 1)
+ return -1;
+ ptr = strchr(argv[0], ':');
+ if (ptr != NULL) {
+ *ptr++ = '\0';
+ if (! el_match(el->el_prog, argv[0]))
return 0;
}
else
@@ -190,7 +198,7 @@ parse__escape(ptr)
break;
}
}
- else if (*p == '^' && isalpha((unsigned char) *p)) {
+ else if (*p == '^' && isalpha((unsigned char) p[1])) {
p++;
c = (*p == '?') ? '\177' : (*p & 0237);
}
diff --git a/lib/libedit/parse.h b/lib/libedit/parse.h
index 263076b30a5..bda660e528f 100644
--- a/lib/libedit/parse.h
+++ b/lib/libedit/parse.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: parse.h,v 1.2 1997/01/16 05:18:40 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/prompt.c b/lib/libedit/prompt.c
index cea7ad7d133..380052adffc 100644
--- a/lib/libedit/prompt.c
+++ b/lib/libedit/prompt.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: prompt.c,v 1.2 1997/01/16 05:18:40 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)prompt.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: prompt.c,v 1.2 1997/01/16 05:18:40 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
diff --git a/lib/libedit/prompt.h b/lib/libedit/prompt.h
index a624fc053e2..6d43675a51c 100644
--- a/lib/libedit/prompt.h
+++ b/lib/libedit/prompt.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: prompt.h,v 1.2 1997/01/16 05:18:41 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/read.c b/lib/libedit/read.c
index ccfc88b8f59..2d1139c6e82 100644
--- a/lib/libedit/read.c
+++ b/lib/libedit/read.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: read.c,v 1.2 1997/01/16 05:18:42 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,9 +37,13 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
-
+#else
+static char rcsid[] = "$OpenBSD: read.c,v 1.2 1997/01/16 05:18:42 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
+
/*
* read.c: Clean this junk up! This is horrible code.
* Terminal read functions
@@ -379,6 +385,11 @@ el_gets(el, nread)
re_refresh_cursor(el);
break;
+ case CC_REDISPLAY:
+ re_clear_lines(el);
+ re_clear_display(el);
+ /* FALLTHROUGH */
+
case CC_REFRESH:
el->el_state.argument = 1;
el->el_state.doingarg = 0;
diff --git a/lib/libedit/refresh.c b/lib/libedit/refresh.c
index b64d0119c6e..8b5ef97b1ba 100644
--- a/lib/libedit/refresh.c
+++ b/lib/libedit/refresh.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: refresh.c,v 1.2 1997/01/16 05:18:42 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: refresh.c,v 1.2 1997/01/16 05:18:42 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
diff --git a/lib/libedit/refresh.h b/lib/libedit/refresh.h
index 4fe50bc9aa3..62039eb169c 100644
--- a/lib/libedit/refresh.h
+++ b/lib/libedit/refresh.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: refresh.h,v 1.2 1997/01/16 05:18:43 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/search.c b/lib/libedit/search.c
index 29b2f6f5234..f1c987de0bf 100644
--- a/lib/libedit/search.c
+++ b/lib/libedit/search.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: search.c,v 1.2 1997/01/16 05:18:44 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: search.c,v 1.2 1997/01/16 05:18:44 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
@@ -464,7 +470,8 @@ cv_search(el, dir)
(void) strcpy(tmpbuf, el->el_search.patbuf);
el->el_search.patbuf[0] = '.';
el->el_search.patbuf[1] = '*';
- (void) strcpy(&el->el_search.patbuf[2], tmpbuf);
+ (void) strncpy(&el->el_search.patbuf[2], tmpbuf, EL_BUFSIZ - 3);
+ el->el_search.patbuf[EL_BUFSIZ - 1] = '\0';
el->el_search.patlen++;
el->el_search.patbuf[el->el_search.patlen++] = '.';
el->el_search.patbuf[el->el_search.patlen++] = '*';
diff --git a/lib/libedit/search.h b/lib/libedit/search.h
index 51c58b4ab5e..5d2a8e6fad2 100644
--- a/lib/libedit/search.h
+++ b/lib/libedit/search.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: search.h,v 1.2 1997/01/16 05:18:44 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/sig.c b/lib/libedit/sig.c
index 94ab4bb8380..e0bb91bfd70 100644
--- a/lib/libedit/sig.c
+++ b/lib/libedit/sig.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: sig.c,v 1.2 1997/01/16 05:18:45 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: sig.c,v 1.2 1997/01/16 05:18:45 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
diff --git a/lib/libedit/sig.h b/lib/libedit/sig.h
index 98da74f44c4..92021100f4e 100644
--- a/lib/libedit/sig.h
+++ b/lib/libedit/sig.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: sig.h,v 1.2 1997/01/16 05:18:45 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/sys.h b/lib/libedit/sys.h
index eae20f61b8d..38321de8261 100644
--- a/lib/libedit/sys.h
+++ b/lib/libedit/sys.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: sys.h,v 1.2 1997/01/16 05:18:46 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/term.c b/lib/libedit/term.c
index 061eb38ce22..8253a86340e 100644
--- a/lib/libedit/term.c
+++ b/lib/libedit/term.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: term.c,v 1.2 1997/01/16 05:18:47 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: term.c,v 1.2 1997/01/16 05:18:47 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
@@ -50,6 +56,7 @@ static char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/4/93";
#include <stdlib.h>
#include <unistd.h>
#include "termcap.h" /* XXX: should be <termcap.h> */
+#include <sys/ioctl.h>
#include <sys/types.h>
#include "el.h"
diff --git a/lib/libedit/term.h b/lib/libedit/term.h
index aa3cd68b2b7..b7ac3e708f1 100644
--- a/lib/libedit/term.h
+++ b/lib/libedit/term.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: term.h,v 1.2 1997/01/16 05:18:48 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/termcap.h b/lib/libedit/termcap.h
index 4fd2cab0ec0..6be66f669f3 100644
--- a/lib/libedit/termcap.h
+++ b/lib/libedit/termcap.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: termcap.h,v 1.2 1997/01/16 05:18:48 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/tokenizer.c b/lib/libedit/tokenizer.c
index 41095fa980f..3446504ba3b 100644
--- a/lib/libedit/tokenizer.c
+++ b/lib/libedit/tokenizer.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: tokenizer.c,v 1.2 1997/01/16 05:18:49 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: tokenizer.c,v 1.2 1997/01/16 05:18:49 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
diff --git a/lib/libedit/tokenizer.h b/lib/libedit/tokenizer.h
index d495dc69ab0..dd7137df4bf 100644
--- a/lib/libedit/tokenizer.h
+++ b/lib/libedit/tokenizer.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: tokenizer.h,v 1.2 1997/01/16 05:18:50 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/tty.c b/lib/libedit/tty.c
index ac99843b774..bcaa5043095 100644
--- a/lib/libedit/tty.c
+++ b/lib/libedit/tty.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: tty.c,v 1.2 1997/01/16 05:18:50 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: tty.c,v 1.2 1997/01/16 05:18:50 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*
diff --git a/lib/libedit/tty.h b/lib/libedit/tty.h
index 12da50dcb5b..2058bd1c0c2 100644
--- a/lib/libedit/tty.h
+++ b/lib/libedit/tty.h
@@ -1,3 +1,5 @@
+/* $OpenBSD: tty.h,v 1.2 1997/01/16 05:18:51 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/lib/libedit/vi.c b/lib/libedit/vi.c
index 030ee2286b0..3c5f6e5ce38 100644
--- a/lib/libedit/vi.c
+++ b/lib/libedit/vi.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: vi.c,v 1.2 1997/01/16 05:18:52 millert Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +37,11 @@
*/
#if !defined(lint) && !defined(SCCSID)
+#if 0
static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: vi.c,v 1.2 1997/01/16 05:18:52 millert Exp $";
+#endif
#endif /* not lint && not SCCSID */
/*