From acfd5755759ee2634e67501a0049f7dad917ebe7 Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Sun, 3 Apr 2022 08:54:32 -0300 Subject: Backport fix for completion of find -exec commands --- debian/changelog | 2 ++ debian/patches/15-find-exec.patch | 20 ++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 23 insertions(+) create mode 100644 debian/patches/15-find-exec.patch diff --git a/debian/changelog b/debian/changelog index 1dc9985b..d2d390b1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,7 @@ bash-completion (1:2.11-6) UNRELEASED; urgency=medium + * Fix completion of find -exec commands (Closes: #1002010). + -- Gabriel F. T. Gomes Thu, 11 Nov 2021 09:14:04 -0300 bash-completion (1:2.11-5) unstable; urgency=medium diff --git a/debian/patches/15-find-exec.patch b/debian/patches/15-find-exec.patch new file mode 100644 index 00000000..fcb963e2 --- /dev/null +++ b/debian/patches/15-find-exec.patch @@ -0,0 +1,20 @@ +commit f1ddf810e4ee6693acb9fab1be1794586aa111a0 +Author: Ville Skyttä +Date: Sat Mar 20 10:41:04 2021 +0200 + + fix(find): don't look for -exec etc command if completing before it + + Closes https://github.com/scop/bash-completion/issues/509 + +diff --git a/completions/find b/completions/find +index 64121eda..f18c7d7e 100644 +--- a/completions/find ++++ b/completions/find +@@ -10,6 +10,7 @@ _find() + local i + for i in ${!words[*]}; do + if [[ ${words[i]} == -@(exec|ok)?(dir) ]]; then ++ ((cword > i)) || break + _command_offset $((i + 1)) + return + fi diff --git a/debian/patches/series b/debian/patches/series index d4cfbb87..e634ce02 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,4 @@ 12-properly-handle-TERM-and-other-envvars.patch 13-backport-support-for-python-9.patch 14-backport-support-for-long-options-in-perltidy.patch +15-find-exec.patch -- cgit v1.2.1