diff --git a/actions/issueflow-reconcile/issueflow-reconcile.sh b/actions/issueflow-reconcile/issueflow-reconcile.sh index f6166a2..1d00b4c 100644 --- a/actions/issueflow-reconcile/issueflow-reconcile.sh +++ b/actions/issueflow-reconcile/issueflow-reconcile.sh @@ -213,7 +213,9 @@ refs_references() { # PR body on stdin -> local issue numbers named by Refs token = substr(rest, RSTART, RLENGTH) sub(/^.*refs[[:space:]:]+/, "", token) print token - rest = substr(rest, RSTART + RLENGTH) + # Retain the token final byte so ^ cannot turn a concatenated + # alphanumeric suffix into a fresh keyword boundary (#234). + rest = substr(rest, RSTART + RLENGTH - 1) } } ' | issue_references \ diff --git a/test/issueflow-reconcile.test.sh b/test/issueflow-reconcile.test.sh index a2ae806..b09a8ff 100644 --- a/test/issueflow-reconcile.test.sh +++ b/test/issueflow-reconcile.test.sh @@ -117,6 +117,8 @@ check "parenthesized prose after a local Refs token is ignored" 0 "" \ test "$(refs_references <<<'Refs #175 (split from #150)')" = 175 check "every Refs occurrence on one line contributes its bound token" 0 "" \ test "$(refs_references <<<'Refs #8. Refs #9.')" = $'8\n9' +check "a concatenated Refs spelling is not a second keyword occurrence" 0 "" \ + test "$(refs_references <<<'Refs #8Refs #9')" = 8 check "lowercase refs in unrelated prose declares nothing" 0 "" \ test -z "$(refs_references <<<'fix refs parsing from #200')" check "Refs without a following token declares nothing" 0 "" \