diff options
| author | Toby Goodwin <toby@paganbooks.eu> | 2018-04-29 21:51:25 +0100 |
|---|---|---|
| committer | Toby Goodwin <toby@paganbooks.eu> | 2018-04-29 21:51:25 +0100 |
| commit | ce98977a948081a3ac6006f730f469f12cba8b3c (patch) | |
| tree | d55f6255817eaca0f66577318c7677ca06cd7e3f | |
| parent | 154fb2264f717aebe4ff149efce42411cefd583f (diff) | |
minor cleanups
| -rw-r--r-- | edit-readline.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/edit-readline.c b/edit-readline.c index 7a9e448..9749b46 100644 --- a/edit-readline.c +++ b/edit-readline.c @@ -35,13 +35,16 @@ static char *dir_join(char *a, char *b) { * completion, but we need to offer two things so it is not taken as the sole * completion. We use "bodge" to hold "sub/" while we return "sub/..." the * first time. Next time, we will notice that "bodge" is set, and return that - * instead. */ + * instead. (It would be better to persuade readline just to append the "/" as + * it does for filename completion, but it's not clear to me if this is + * possible.) + */ static char *bodge; /* Decide if this directory entry is a completion candidate, either executable * or a directory. "dname" is the absolute path of the directory, "name" is the * current entry. "subdirs" is the name being completed up to and including the - * last slash (or NULL if there is no slash, "prefix" is the remainder of the + * last slash (or NULL if there is no slash), "prefix" is the remainder of the * name being completed, "len" is the length of "prefix". */ static char *entry(char *dname, char *name, char *subdirs, @@ -98,7 +101,6 @@ static char *compl_extcmd(const char *text, int state) { if (!state) { split_last_slash(text, &subdirs, &prefix); d = NULL; - dname = NULL; path = varlookup("path"); len = strlen(prefix); bodge = NULL; |