Skip to content

Commit ca195bf

Browse files
committed
Join continued lines with nothing, as shell does
A backslash-newline is removed entirely in shell; it does not become whitespace. Joining with a space split tokens that bash keeps together, so `"https\` + `://host/pkg.tar.gz"` — one URL to bash, confirmed by sourcing it — arrived at the extractor as `https ://host/pkg.tar.gz` and matched nothing. Another download skipped silently. Contrived to write by hand, but the joiner was approximating shell semantics rather than following them, and that gap is what the check keeps getting caught by. Ordinary continuations already carry whitespace around the backslash, so nothing else changes. Verified: real definitions pass, the split-scheme URL is now caught, and continuations with digests still pass in all three forms.
1 parent c689796 commit ca195bf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎bin/ci‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ join_continuations() {
9797
local line acc=""
9898
while IFS= read -r line || [ -n "$line" ]; do
9999
if [ "${line%\\}" != "$line" ]; then
100-
acc="${acc}${line%\\} "
100+
# Join with nothing, matching shell: a backslash-newline is removed entirely, it
101+
# does not become whitespace. Inserting a space would split tokens shell keeps
102+
# together — `"https\` + `://host/x"` is one URL to bash but would arrive here as
103+
# `https ://host/x` and match nothing, silently skipping that download. Ordinary
104+
# continuations already carry their own whitespace around the backslash.
105+
acc="${acc}${line%\\}"
101106
else
102107
printf '%s%s\n' "$acc" "$line"
103108
acc=""

0 commit comments

Comments
 (0)