summaryrefslogtreecommitdiff
path: root/lib/libedit/parse.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>1999-02-05 20:38:01 +0000
committerchristos <christos@NetBSD.org>1999-02-05 20:38:01 +0000
commit0d4dea92335de49f2e2962e983f154cf9ff88b6a (patch)
tree08ec03016dbc52fa58a850037888f992ca8bc10e /lib/libedit/parse.c
parent58beb19c16232460d8d50850bfcfdf672e094e75 (diff)
M-X:<enter> core-dumped.
Diffstat (limited to 'lib/libedit/parse.c')
-rw-r--r--lib/libedit/parse.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libedit/parse.c b/lib/libedit/parse.c
index df2dd12cb8e..0837efe13e6 100644
--- a/lib/libedit/parse.c
+++ b/lib/libedit/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.9 1998/12/12 20:08:22 christos Exp $ */
+/* $NetBSD: parse.c,v 1.10 1999/02/05 20:38:01 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: parse.c,v 1.9 1998/12/12 20:08:22 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.10 1999/02/05 20:38:01 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -115,15 +115,17 @@ el_parse(el, argc, argv)
char *tprog;
size_t l;
+ if (ptr == argv[0])
+ return 0;
l = ptr - argv[0] - 1;
- tprog = (char *)malloc(l + 1);
+ tprog = (char *)el_malloc(l + 1);
if (tprog == NULL)
return 0;
(void)strncpy(tprog, argv[0], l);
tprog[l] = '\0';
ptr++;
l = el_match(el->el_prog, tprog);
- free(tprog);
+ el_free(tprog);
if (!l)
return 0;
}