From b59d3eaf10f9af5485ea46d6eeb2cebde8a21117 Mon Sep 17 00:00:00 2001 From: lukem Date: Thu, 9 Jan 1997 13:12:14 +0000 Subject: * 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 [christos - the author of libedit - ok-ed the man pages in general (which I wrote from scratch by RTFS) as well as the bugfix] --- lib/libedit/parse.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/libedit/parse.c') diff --git a/lib/libedit/parse.c b/lib/libedit/parse.c index 2fe746f370b..115f84b0caf 100644 --- a/lib/libedit/parse.c +++ b/lib/libedit/parse.c @@ -97,12 +97,10 @@ 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)) + ptr = strchr(argv[0], ':'); + if (ptr != NULL) { + *ptr++ = '\0'; + if (! el_match(el->el_prog, argv[0])) return 0; } else -- cgit