From 02f1dc94fdad9b09db9cd4f40d8bf3ce02142da2 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Tue, 14 Aug 2018 06:10:09 +0100 Subject: fix on gph rendering --- gosher | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gosher b/gosher index 2a1acfa..16d2d83 100755 --- a/gosher +++ b/gosher @@ -37,7 +37,7 @@ ## ## -## NETCAT: the netcat command to use, and any additional option +## NETCAT: the netcat command to use, without additional options ## ### Original netcat ##NETCAT="nc.traditional" @@ -48,6 +48,11 @@ ### OpenBSD netcat NETCAT="nc" +## +## NETCAT_OPTS: any additional options to netcat +## +NETCAT_OPTS="" + ## ## STYLE: The way in which netcat will talk to gosher_serve ## @@ -164,9 +169,9 @@ serve_index(){ while read -r line; do rline=$(echo "$line" | tr -d '\r') case "$rline" in - '['*) - line=$(echo "$rline" | sed -r -e 's/^\[//;s/\]$//;s/\|/ /g;s/ / /;') - line=$(echo "$line" | sed -r -e "s/server port/$HOSTNAME $PORT/") + '['*) + line=$(echo "$rline" | sed -r -e "s/ / /g;s/server\|port\]$/$HOSTNAME $PORT/") + line=$(echo "$line" | sed -r -e 's/^\[//;s/\]$//;s/\|/ /g;s/ //1') ;; t*) line=$(echo "$rline" | cut -b 2-) -- cgit v1.2.3