commit a72c49d7914d7dd118bbd3d10734f0645524d64a
parent 89fa9aae7d63afb2829987c6b4058fb42f03ce37
Author: Bert Münnich <ber.t@posteo.de>
Date: Mon, 7 Jan 2019 20:52:19 +0100
Fix command completion of absolute paths
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git 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;
}