diff options
| author | lukem <lukem@NetBSD.org> | 1997-01-09 13:12:14 +0000 |
|---|---|---|
| committer | lukem <lukem@NetBSD.org> | 1997-01-09 13:12:14 +0000 |
| commit | b59d3eaf10f9af5485ea46d6eeb2cebde8a21117 (patch) | |
| tree | c2adbbb2b56c4087c05693f1726c5aeb2f3fe960 /lib/libedit/parse.c | |
| parent | 4ed8b99e7b8b87c96058b6c5776f368db29bfa04 (diff) | |
* 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]
Diffstat (limited to 'lib/libedit/parse.c')
| -rw-r--r-- | lib/libedit/parse.c | 10 |
1 files changed, 4 insertions, 6 deletions
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 |
