diff options
| author | Bert Münnich <ber.t@posteo.de> | 2019-01-07 20:52:19 +0100 |
|---|---|---|
| committer | Bert Münnich <ber.t@posteo.de> | 2019-12-06 17:57:34 +0100 |
| commit | a72c49d7914d7dd118bbd3d10734f0645524d64a (patch) | |
| tree | 376cfc3438f2e91bf3ccf3c2f16dd9bee0ce9491 /edit-readline.c | |
| parent | 89fa9aae7d63afb2829987c6b4058fb42f03ce37 (diff) | |
Fix command completion of absolute paths
Diffstat (limited to 'edit-readline.c')
| -rw-r--r-- | edit-readline.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/edit-readline.c b/edit-readline.c index 2c3f483..f43effb 100644 --- a/edit-readline.c +++ b/edit-readline.c @@ -150,7 +150,7 @@ void split_last_slash(const char *text, char **pre, char **post) { static char *compl_extcmd(const char *text, int state) { static char *dname, *prefix, *subdirs; static DIR *d; - static List *path; + static List nil, *path; static size_t len; if (!state) { @@ -158,7 +158,10 @@ static char *compl_extcmd(const char *text, int state) { split_last_slash(utext, &subdirs, &prefix); efree(utext); d = NULL; - path = varlookup("path"); + if (subdirs && isabsolute(subdirs)) + path = &nil; + else + path = varlookup("path"); len = strlen(prefix); bodge = NULL; } |