mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
sh: tab-complete aliases
Differential Revision: https://reviews.freebsd.org/D40619
This commit is contained in:
parent
2fc4a84ed8
commit
0fd450e289
|
@ -50,6 +50,7 @@ static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
|
|||
/*
|
||||
* Editline and history functions (and glue).
|
||||
*/
|
||||
#include "alias.h"
|
||||
#include "shell.h"
|
||||
#include "parser.h"
|
||||
#include "var.h"
|
||||
|
@ -671,6 +672,14 @@ static char
|
|||
goto out;
|
||||
matches = rmatches;
|
||||
}
|
||||
for (const struct alias *ap = NULL; (ap = iteralias(ap)) != NULL;) {
|
||||
if (strncmp(ap->name, text, curpos) != 0)
|
||||
continue;
|
||||
rmatches = add_match(matches, ++i, &size, strdup(ap->name));
|
||||
if (rmatches == NULL)
|
||||
goto out;
|
||||
matches = rmatches;
|
||||
}
|
||||
out:
|
||||
free(free_path);
|
||||
if (i == 0) {
|
||||
|
|
Loading…
Reference in a new issue