summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-01-12 21:33:35 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-01-12 21:33:35 +0000
commit5b6fd65dbfcb7ec622b234a3a55d028c0028f24f (patch)
tree765d90c8273e168771ec7fbae0f5bd93060c86cc /parse.c
parent4935023390c7a3c08b4506f8947162bf27915c0c (diff)
Notes
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/parse.c b/parse.c
index f1c4391a2f04..47d6f7d9b9d3 100644
--- a/parse.c
+++ b/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.26 2011/08/16 16:25:15 christos Exp $ */
+/* $NetBSD: parse.c,v 1.27 2014/07/06 18:15:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: parse.c,v 1.26 2011/08/16 16:25:15 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.27 2014/07/06 18:15:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -276,10 +276,11 @@ parse__string(Char *out, const Char *in)
protected int
parse_cmd(EditLine *el, const Char *cmd)
{
- el_bindings_t *b;
+ el_bindings_t *b = el->el_map.help;
+ size_t i;
- for (b = el->el_map.help; b->name != NULL; b++)
- if (Strcmp(b->name, cmd) == 0)
- return b->func;
+ for (i = 0; i < el->el_map.nfunc; i++)
+ if (Strcmp(b[i].name, cmd) == 0)
+ return b[i].func;
return -1;
}