diff options
author | Kevin Locke <kevin@kevinlocke.name> | 2021-03-13 10:18:37 -0700 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2021-03-27 17:48:26 -0300 |
commit | c325fbfedd25ca4254087493336ebf825a99a019 (patch) | |
tree | 3354b1c27858554c8d6017d74be7d1bb3322e2e9 | |
parent | e6ce7cbf4e5dd6a7fe44bd957dbaed91c5cae853 (diff) | |
download | bash-completion-c325fbfedd25ca4254087493336ebf825a99a019.tar.gz |
dh_bash-completion: Tighten is_filelist matching
The regular expressions in is_filelist which matches "well-known idioms
on bash scripts" currently matches the path to the bash-completion
script in the nitrokey-app package:
'data/bash-autocomplete/nitrokey-app' =~ /\s*complete.*-[A-Za-z].*/
Avoid this by ensuring the is only matched when following a line break
or character which can be used to chain shell commands.
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
-rw-r--r-- | debian/changelog | 3 | ||||
-rwxr-xr-x | debian/extra/debhelper/dh_bash-completion | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index d25c6fe4..1e4483be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,8 @@ bash-completion (1:2.11-3) UNRELEASED; urgency=medium + [ Kevin Locke ] + * Improve file matching in dh_bash-completion (Closes: #985151). + -- Gabriel F. T. Gomes <gabriel@debian.org> Sat, 27 Mar 2021 17:39:56 -0300 bash-completion (1:2.11-2) unstable; urgency=medium diff --git a/debian/extra/debhelper/dh_bash-completion b/debian/extra/debhelper/dh_bash-completion index d1d9bf2e..7999151c 100755 --- a/debian/extra/debhelper/dh_bash-completion +++ b/debian/extra/debhelper/dh_bash-completion @@ -75,7 +75,7 @@ sub is_filelist { # # - If we see an "if...then" construction in the file. We # take into account multi-line statements. - if (/\s*complete.*-[A-Za-z].*/ + if (/(^|[|&;])\s*complete.*-[A-Za-z].*/ || /\$\(.*\)/ || /\s*compgen.*-[A-Za-z].*/ || /\s*if.*;.*then/s) { |