about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-06-08 17:19:54 -0500
committerCase Duckworth2022-06-08 17:19:54 -0500
commit21cef8fe4346903764b9903e8b011180daa18172 (patch)
treef135812c0193c1da8efbc22ed8d176b575efc899
parentClarify comment (diff)
downloadbollux-21cef8fe4346903764b9903e8b011180daa18172.tar.gz
bollux-21cef8fe4346903764b9903e8b011180daa18172.zip
Special-case file: protocol (empty string allowed)
-rwxr-xr-xbollux4
1 files changed, 3 insertions, 1 deletions
diff --git a/bollux b/bollux index 668930e..4a8db07 100755 --- a/bollux +++ b/bollux
@@ -477,7 +477,9 @@ ujoin() { # ujoin URL_ARRAY<name>
477 printf -v URL_ARRAY[0] "%s:" "${URL_ARRAY[1]}" 477 printf -v URL_ARRAY[0] "%s:" "${URL_ARRAY[1]}"
478 fi 478 fi
479 479
480 if ucdef URL_ARRAY[2]; then 480 # Need special casing for file: protocol:
481 # https://datatracker.ietf.org/doc/html/rfc1738#section-3.10
482 if ucdef URL_ARRAY[2] || [[ "${URL_ARRAY[1]}" == file ]]; then
481 printf -v URL_ARRAY[0] "${URL_ARRAY[0]}//%s" "${URL_ARRAY[2]}" 483 printf -v URL_ARRAY[0] "${URL_ARRAY[0]}//%s" "${URL_ARRAY[2]}"
482 fi 484 fi
483 485