astro

a POSIX shell compatible gemini client (mirror of https://github.com/blmayer/astro)
git clone https://git.clttr.info/astro.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 7f298614e4f35932136d6411c7ccab97408c1661
parent 43699fd21f9d013d03fe78624ab3e45b274b11d7
Author: blmayer <bleemayer@gmail.com>
Date:   Mon, 16 Aug 2021 20:10:49 -0300

Fixed some relative paths navigation

Diffstat:
Mastro | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/astro b/astro @@ -55,7 +55,7 @@ $(echo "$1" | sed -E 's@^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*)) EOF [ "$debug" ] && echo "Parsed URL: proto: $proto host: $hostport path: $path" >&2 && sleep 2 - if [ "$host" ] && [ "$hostport" = "" ] + if [ "$oldhost" ] && [ "$hostport" = "" ] then hostport="$host" elif [ "$hostport" = "" ] @@ -68,6 +68,13 @@ EOF $hostport EOF + # Check path continuation + if [ "$oldhost" = "$host" ] + then + case "$oldpath" in + *"/") path="$oldpath$path" ;; + esac + fi [ "$debug" ] && echo "Response: proto: ${proto:-gemini} host: $host port: ${port:-1965} path: ${path#/}" >&2 && sleep 2 echo "${proto:-gemini}" "$host" "${port:-1965}" "${path#/}" "$rest" return 0 @@ -256,7 +263,7 @@ fetch() { esac read -r proto host port path << EOF -$(host="$2" parseurl "$url") +$(oldhost="$2" oldpath="$4" parseurl "$url") EOF fetch "$proto" "$host" "$port" "$path" }