Problem
bashunit::reports::__gha_encode encodes % first, deliberately, so the
sequences it injects stay literal:
That substitution does not happen on Bash 3.0. The % immediately after //
is read as the anchor-to-end syntax with an empty pattern, so the replacement
is appended and the text is left alone:
| bash | ${t//%/%25} on 100% and 50% |
|---|
| 3.2, 4.4, 5 | 100%25 and 50%25 |
| 3.0 | 100% and 50%%25 |
So on Bash 3.0 an annotation carrying a % reaches GitHub unencoded, and gains
a stray %25 at the end. A message like coverage 80% -> 90% renders wrong,
and a %0A a user wrote themselves would be decoded as a newline.
Same root cause as #1119, which hit # instead of % — the anchor forms
${var//#pat/repl} and ${var//%pat/repl} swallow a bare #/% pattern on
3.0. [%] means the same thing on 3.0, 3.2, 4.4 and 5.
Found by grepping src/ for the pattern after #1119; this is the only other
occurrence.
Problem
bashunit::reports::__gha_encodeencodes%first, deliberately, so thesequences it injects stay literal:
text="${text//%/%25}"That substitution does not happen on Bash 3.0. The
%immediately after//is read as the anchor-to-end syntax with an empty pattern, so the replacement
is appended and the text is left alone:
${t//%/%25}on100% and 50%100%25 and 50%25100% and 50%%25So on Bash 3.0 an annotation carrying a
%reaches GitHub unencoded, and gainsa stray
%25at the end. A message likecoverage 80% -> 90%renders wrong,and a
%0Aa user wrote themselves would be decoded as a newline.Same root cause as #1119, which hit
#instead of%— the anchor forms${var//#pat/repl}and${var//%pat/repl}swallow a bare#/%pattern on3.0.
[%]means the same thing on 3.0, 3.2, 4.4 and 5.Found by grepping
src/for the pattern after #1119; this is the only otheroccurrence.