summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@thebackupbox.net>2022-10-02 23:08:43 -0500
committerepoch <epoch@thebackupbox.net>2022-10-02 23:08:43 -0500
commit74a05d21e26430880a2f59f9a3fe030e64be19c8 (patch)
tree6441d87167d97c4dd25fd4f7247b325d1081c970
parent556e02cfd4fe4f208abe254f41bffcf14baed8dc (diff)
downloaduritools-74a05d21e26430880a2f59f9a3fe030e64be19c8.tar.gz
uritools-74a05d21e26430880a2f59f9a3fe030e64be19c8.zip
added special-case of empty input mapping to base-uriHEADmaster
-rwxr-xr-xuri-absolution7
1 files changed, 5 insertions, 2 deletions
diff --git a/uri-absolution b/uri-absolution
index a1eb6c1..1683071 100755
--- a/uri-absolution
+++ b/uri-absolution
@@ -8,15 +8,18 @@ most_of_path="$(printf "%s\n" "$base_uri" | uricut -p | rev | cut -d/ -f2- | rev
### this is the verbose version for debugging.
### to enable debug mode, uncomment this, and comment out the next sed.
#sed \
-#'s|^<[ \t]*\([A-Za-z][A-Za-z+.-]*:[^ \t]*\)>|(absolute) \1|g;t
+#'s|^<>$|(blank input) '"${base_uri}"'|g;t
+#s|^<[ \t]*\([A-Za-z][A-Za-z+.-]*:[^ \t]*\)>|(absolute) \1|g;t
#s|^<[ \t]*\(#[^ \t]*\)>|(fragmentid_relative) '"${base_uri}"'\1|g;t
#s|^<[ \t]*\(?[^ \t]*\)>|(querystring_relative) '"$scheme"'://'"$domain""$path"'\1|g;t
#s|^<[ \t]*\(//[^ \t]*\)>|(scheme_relative) '"$scheme"':\1|g;t
#s|^<[ \t]*\(/[^ \t]*\)>|(absolute_path) '"$scheme"'://'"$domain"'\1|g;t
#s|^<[ \t]*\([^ \t]*\)>|(same-dir path relative) '"$scheme"'://'"$domain""$most_of_path"'/\1|g'
+#exit 0
sed -u \
-'s|^<[ \t]*\([A-Za-z][A-Za-z+.-]*:[^ \t]*\)>|\1|g;t
+'s|^<>$|'"${base_uri}"'|g;t
+s|^<[ \t]*\([A-Za-z][A-Za-z+.-]*:[^ \t]*\)>|\1|g;t
s|^<[ \t]*\(#[^ \t]*\)>|'"${base_uri}"'\1|g;t
s|^<[ \t]*\(?[^ \t]*\)>|'"$scheme"'://'"$domain""$path"'\1|g;t
s|^<[ \t]*\(//[^ \t]*\)>|'"$scheme"':\1|g;t