lineedit: fix matching of directories when searching PATH
Commit8baa643a3
(lineedit: match local directories when searching PATH) included subdirectories of the current directory in the search when tab-completing commands. Unfortunately a short time later commit1d180cd74
(lineedit: use strncmp instead of is_prefixed_with (we know the length)) broke this feature by returning an incorrect length for the array of paths. Fix the length and reinstate matching of subdirectories. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
8d198665a0
commit
64e967fabb
@ -825,8 +825,8 @@ static unsigned path_parse(char ***p)
|
||||
res[npth++] = tmp;
|
||||
}
|
||||
/* special case: "match subdirectories of the current directory" */
|
||||
/*res[npth++] = NULL; - filled by xzalloc() */
|
||||
return npth;
|
||||
/*res[npth] = NULL; - filled by xzalloc() */
|
||||
return npth + 1;
|
||||
}
|
||||
|
||||
/* Complete command, directory or file name.
|
||||
|
Loading…
Reference in New Issue
Block a user