diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-30 20:30:41 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-30 20:30:41 -0800 |
commit | da0481ced96f0c587da25dc7252e028095e90420 (patch) | |
tree | 2d4c8e6910d6461250a140275251deea656ebc39 /pcomplete.c | |
parent | a102dbf889a14adf8a2dee59ad7a61d0b9563ff6 (diff) | |
download | vyatta-bash-da0481ced96f0c587da25dc7252e028095e90420.tar.gz vyatta-bash-da0481ced96f0c587da25dc7252e028095e90420.zip |
Remove Vyatta mods to allow empty command completion
Newer versions of bash supports completing on empty command line.
No Vyatta changes are necessary.
Diffstat (limited to 'pcomplete.c')
-rw-r--r-- | pcomplete.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/pcomplete.c b/pcomplete.c index 541bdad..e4f2059 100644 --- a/pcomplete.c +++ b/pcomplete.c @@ -1503,20 +1503,15 @@ programmable_completions (cmd, word, start, end, foundp) { retry = 0; - if (in_vyatta_restricted_mode(OUTPUT) && strcmp(cmd, word) == 0) { - /* command completion */ - ret = gen_progcomp_completions ("", cmd, word, start, end, &found, &retry, &lastcs); - } else { - /* We look at the basename of CMD if the full command does not have - an associated COMPSPEC. */ - ret = gen_progcomp_completions (cmd, cmd, word, start, end, &found, &retry, &lastcs); - if (found == 0) - { - t = strrchr (cmd, '/'); - if (t && *(++t)) - ret = gen_progcomp_completions (t, cmd, word, start, end, &found, &retry, &lastcs); - } - } + /* We look at the basename of CMD if the full command does not have + an associated COMPSPEC. */ + ret = gen_progcomp_completions (cmd, cmd, word, start, end, &found, &retry, &lastcs); + if (found == 0) + { + t = strrchr (cmd, '/'); + if (t && *(++t)) + ret = gen_progcomp_completions (t, cmd, word, start, end, &found, &retry, &lastcs); + } if (found == 0) ret = gen_progcomp_completions (DEFAULTCMD, cmd, word, start, end, &found, &retry, &lastcs); |