The attached patch (against devscripts master) fixes this bug. The $"
and $' checks counted quotes over the whole line prefix; quotes inside
a command substitution belong to a fresh quoting context, so a
trailing $ inside $(...) (a grep end-anchor, the tail of ${pkg}) was
misread as a locale string start. The patch counts quotes at the
current substitution level instead (new helper
count_quotes_at_current_level, used by both checks).Regression lines added to test/bashisms/gettext.sh fail without the patch; the suite passes with it, and genuine cases (echo $"hello world", nested echo "$(echo $"inner")") still fire. Scope note: the $'...' flavour in the full VFlib3 mkt1enc.sh file could not be re-tested; the fix targets the shared counting flaw behind both minimal reproducers. Disclosure, encouraged by Debian GR 2026-002: prepared with AI assistance; verified by me against the reproducers and suite.
fp1-quote-tail.patch
Description: Binary data

