summaryrefslogtreecommitdiffstats
path: root/lib/libedit/parse.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1997-06-25 08:14:24 +0000
committermsmith <msmith@FreeBSD.org>1997-06-25 08:14:24 +0000
commitf4312c45dc5fb1b4831e63087e8563fa0fa4601f (patch)
treebfe4a6c5e19e7694273d28cb1b36a820a5ebad0d /lib/libedit/parse.c
parentd2cf9d630277a4d4f8601691fb1ac28b727e417e (diff)
downloadFreeBSD-src-f4312c45dc5fb1b4831e63087e8563fa0fa4601f.zip
FreeBSD-src-f4312c45dc5fb1b4831e63087e8563fa0fa4601f.tar.gz
Update libedit with changes from NetBSD. Includes history load/save,
some buffer overflow guards and some stylistic cleanups. Also adds manpages. Obtained from: NetBSD
Diffstat (limited to 'lib/libedit/parse.c')
-rw-r--r--lib/libedit/parse.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/libedit/parse.c b/lib/libedit/parse.c
index 5f648a1..751cc19 100644
--- a/lib/libedit/parse.c
+++ b/lib/libedit/parse.c
@@ -47,6 +47,9 @@ static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
* echotc
* settc
* gettc
+ * history
+ * settc
+ * setty
*/
#include "sys.h"
#include "el.h"
@@ -98,14 +101,11 @@ el_parse(el, argc, argv)
int i;
if (argc < 1)
- return 0;
-
- for (ptr = argv[0]; *ptr && *ptr != ':'; ptr++)
- continue;
-
- if (*ptr == ':') {
- *ptr = '\0';
- if (el_match(el->el_prog, ptr))
+ return -1;
+ ptr = strchr(argv[0], ':');
+ if (ptr != NULL) {
+ *ptr++ = '\0';
+ if (! el_match(el->el_prog, argv[0]))
return 0;
}
else
@@ -193,7 +193,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);
}
OpenPOWER on IntegriCloud