summaryrefslogtreecommitdiff
path: root/gosher
diff options
context:
space:
mode:
Diffstat (limited to 'gosher')
-rwxr-xr-xgosher13
1 files 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"
@@ -49,6 +49,11 @@
NETCAT="nc"
##
+## NETCAT_OPTS: any additional options to netcat
+##
+NETCAT_OPTS=""
+
+##
## STYLE: The way in which netcat will talk to gosher_serve
##
### fork with "-c" (Does *not* work with OpenBSD netcat!!!!!)
@@ -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-)