~thalia/tannhauser

72038a6d9303e1c53afe19cc6a0a65731645dc2f — T W 1 year, 7 months ago 97882ed
Added support for user input with selector 7
2 files changed, 13 insertions(+), 2 deletions(-)

M gmi2gph.awk
M tannhauser.dcgi
M gmi2gph.awk => gmi2gph.awk +2 -2
@@ 47,7 47,7 @@ BEGIN {
                else
                    for (i = 3; i <= NF; i++)
                        printf("%s ", $i)
                printf("|/tannhauser.dcgi?%s%s|localhost|70]\n", host, $2)
                printf("|/tannhauser.dcgi?%s%s|localhost|70]\n", path, $2)

            } else if (substr($2, 0, 2) == "//") {        # Sans gemini:
                sub(/\/\//, "", $2)


@@ 67,7 67,7 @@ BEGIN {
                else
                    for (i = 3; i <= NF; i++)
                        printf("%s ", $i)
                printf("|/tannhauser.dcgi?%s%s|localhost|70]\n", host, $2)
                printf("|/tannhauser.dcgi?%s/%s|localhost|70]\n", path, $2)
            }
        } else {                                 # This line is not a hyperlink
            print $0

M tannhauser.dcgi => tannhauser.dcgi +11 -0
@@ 34,6 34,17 @@ if [ -n "$cgiargs" ]; then      # We're following a link through the proxy
    url="gemini://$cgiargs"
    host="$(echo "$cgiargs" | cut -d '/' -f1)"
    gatepath="$cgiargs"
elif [ -n "$cgisearch" ]; then  # Process user input
    if [ "$(echo "$cgisearch" | cut -d '/' -f1)" = "gemini:" ]; then
        # gemini://host.tld/path
        url="$cgisearch"
        host="$(echo "$cgisearch" | cut -d '/' -f3)"
        gatepath="${cgisearch%%gemini://}"
    else
        url="gemini://$cgisearch"
        host="$(echo "$cgisearch" | cut -d '/' -f1)"
        gatepath="$cgisearch"
    fi
else
    printf "CGI Error: \$cgisearch and \$cgiargs are empty\n"
    print_debug