summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-04-23 12:06:53 -0700
committerJohn Southworth <john.southworth@vyatta.com>2011-04-23 12:06:53 -0700
commit7989d1eb025aabad504942a2de95b9b73de02133 (patch)
treea20c7b33093cff825160f8da5245d1decbd41c9f
parentff4314d1fc9b12ae63a35b894146d93f77abd48d (diff)
downloadvyatta-bash-7989d1eb025aabad504942a2de95b9b73de02133.tar.gz
vyatta-bash-7989d1eb025aabad504942a2de95b9b73de02133.zip
bugfix 6569: Put patch for vyatta restricted mode and first word COMPSPECS back into pcomplete.c.
-rw-r--r--pcomplete.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/pcomplete.c b/pcomplete.c
index e4f2059..49f2eb5 100644
--- a/pcomplete.c
+++ b/pcomplete.c
@@ -1503,15 +1503,17 @@ programmable_completions (cmd, word, start, end, foundp)
{
retry = 0;
- /* 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)
+ if (!(in_vyatta_restricted_mode(OUTPUT) && strcmp(cmd, word) == 0)) {
+ /* 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);
+ 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);