#1152270 checkbashisms: "sourced script with arguments" false positive on "." in case pattern lists

Package:
devscripts
Source:
devscripts
Description:
scripts to make the life of a Debian Package maintainer easier
Submitter:
Tomáš Chvátal
Date:
2026-10-27 11:27:02 UTC
Severity:
normal
#1152270#5
Date:
2026-10-27 11:26:00 UTC
From:
To:
checkbashisms reports "sourced script with arguments" for a "."
that is data in a case pattern list (real instance: mtools tgz):

    #!/bin/sh
    case $name in
      "" | . | .. | */) echo hidden ;;
    esac

Actual output (checkbashisms 2.26.9, exit 1):

    possible bashism in test.sh line 3 (sourced script with arguments):
      "" | . | .. | */) echo hidden ;;

Expected: no output. The "." alternatives are glob patterns for
the literal directory entries; case patterns are not command
position (POSIX XCU 2.9.4.3), so nothing is sourced.

The companion case — a quoted command substitution with nested
quotes as the sole operand of "." — is already tracked as #870309
and is deliberately not part of this report.

[Hint: do not treat "." as the builtin outside command position.]

Found downstream (openSUSE/rpmlint corpus): this shape occurs
among the 14 files hitting the wider "sourced script with
arguments" false-positive class.

Disclosure, encouraged by GR 2026-002: this report was drafted with
AI assistance; the reproducers were verified by me against
checkbashisms 2.26.9.