Special-case file: protocol (empty string allowed)

This commit is contained in:
Case Duckworth 2022-06-08 17:19:54 -05:00
parent eb8f74b391
commit 21cef8fe43
1 changed files with 3 additions and 1 deletions

4
bollux
View File

@ -477,7 +477,9 @@ ujoin() { # ujoin URL_ARRAY<name>
printf -v URL_ARRAY[0] "%s:" "${URL_ARRAY[1]}"
fi
if ucdef URL_ARRAY[2]; then
# Need special casing for file: protocol:
# https://datatracker.ietf.org/doc/html/rfc1738#section-3.10
if ucdef URL_ARRAY[2] || [[ "${URL_ARRAY[1]}" == file ]]; then
printf -v URL_ARRAY[0] "${URL_ARRAY[0]}//%s" "${URL_ARRAY[2]}"
fi