Port changes in manpage from previous versions to a quilt patch.
Also fix errors in manpage.

Author: Chris Taylor <ctaylor@debian.org>
Date: 10FEB2010
--- a/doc/socat.1
+++ b/doc/socat.1
@@ -94,7 +94,7 @@ Logs information about file descriptors
 Writes messages to syslog instead of stderr; severity as defined with \-d
 option\&. With optional <facility>, the syslog type can
 be selected, default is \(dq\&daemon\(dq\&\&. 
-.IP "\fB\f(CW\-lf\fP\fP\f(CW <logfile>\fP"
+.IP "\fB\f(CW\-lf<logfile>\fP"
 Writes messages to <logfile> [filename] instead of
 stderr\&. 
 .IP "\fB\f(CW\-ls\fP\fP"
@@ -1387,7 +1387,7 @@ TCP\-LISTEN
 .IP "\fB\f(CWUNIX\-SENDTO:<filename>\fP\fP"
 Communicates with the specified peer socket, defined by [<filename>] assuming it is a UNIX domain datagram socket\&.
 It sends packets to and receives packets from that peer socket only\&.
-Please note that it might be neccessary to bind the
+Please note that it might be necessary to bind the
 local socket to an address (e\&.g\&. \f(CW/tmp/sock1\fP, which must not exist
 before)\&.
 This address type works well with socat UNIX\-RECVFROM and UNIX\-RECV address
@@ -1542,7 +1542,7 @@ Because all current \fBsocat\fP address
 options may be applied to any address\&. 
 .br 
 Note: Some of these options are also member of another option group, that
-provides an other, non\-fd based mechanism\&.
+provides another, non\-fd based mechanism\&.
 For these options, it depends on the actual address type and its option groups 
 which mechanism is used\&. The second, non\-fd based mechanism is prioritized\&.
 .IP "\fB\f(CWcloexec=<bool>\fP\fP"
@@ -1727,7 +1727,7 @@ terminates the socket even if it is shar
 long as there are still links from other processes\&.
 .br 
 Similarly, when an address of type EXEC or SYSTEM is ended, socat usually
-will explicitely kill the sub process\&. With this option, it will just close
+will explicitly kill the sub process\&. With this option, it will just close
 the file descriptors\&.
 .IP "\fB\f(CWshut\-none\fP\fP"
 Changes the (address dependent) method of shutting down the write part of a
@@ -1751,7 +1751,7 @@ shut\-null)\&.
 .IP "\fB\f(CWioctl\-void=<request>\fP\fP"
 Calls \f(CWioctl()\fP with the request value as second argument and NULL as
 third argument\&. This option allows to utilize ioctls that are not
-explicitely implemented in socat\&.
+explicitly implemented in socat\&.
 .IP "\fB\f(CWioctl\-int=<request>:<value>\fP\fP"
 Calls \f(CWioctl()\fP with the request value as second argument and the integer
 value as third argument\&.
@@ -2517,9 +2517,11 @@ After establishing a connection, handles
 keeps the parent process attempting to produce more connections, either by
 listening or by connecting in a loop (example)\&.
 .br 
-SSL\-CONNECT and SSL\-LISTEN differ in when they actually fork off the child:
-SSL\-LISTEN forks \fIbefore\fP the SSL handshake, while SSL\-CONNECT forks
-\fIafterwards\fP\&.
+OPENSSL\-CONNECT and OPENSSL\-LISTEN differ in when they actually fork off the
+child:
+
+OPENSSL\-LISTEN forks \fIbefore\fP the SSL handshake, while OPENSSLSSL\-CONNECT
+forks \fIafterwards\fP\&.
 RETRY and FOREVER options are not inherited by the child process\&.
 .br 
 
@@ -3134,7 +3136,7 @@ close the relay with ^D or abort it with
 .IP 
 \.LP
 \.nf
-\fBsocat -d -d READLINE,history=$HOME/.http_history \\ 
+\fBsocat \-d \-d READLINE,history=$HOME/.http_history \\ 
 TCP4:www.domain.org:www,crnl\fP
 \.fi
 .IP 
@@ -3152,11 +3154,11 @@ installs a simple TCP port forwarder\&.
 TCP4\-LISTEN it listens on local port \(dq\&www\(dq\& until a
 connection comes in, accepts it, then connects to the remote host
 (TCP4) and starts data transfer\&. It will not accept
-a econd connection\&. 
+a second connection\&. 
 .IP 
 \.LP
 \.nf
-\fBsocat -d -d -lmlocal2 \\ 
+\fBsocat \-d \-d \-lmlocal2 \\ 
 TCP4-LISTEN:80,bind=myaddr1,reuseaddr,fork,su=nobody,range=10.0.0.0/8 \\ 
 TCP4:www.domain.org:80,bind=myaddr2\fP
 \.fi
@@ -3261,7 +3263,7 @@ might also be a listening UNIX domain so
 \.LP
 \.nf
 \fB(sleep 5; echo PASSWORD; sleep 5; echo ls; sleep 1) | 
-socat - EXEC:'ssh -l user server',pty,setsid,ctty\fP
+socat - EXEC:'ssh \-l user server',pty,setsid,ctty\fP
 \.fi
 .IP 
 EXEC\(cq\&utes an ssh session to server\&. Uses a pty for communication between \fBsocat\fP and
@@ -3271,7 +3273,7 @@ a new process group (setsid), so ssh acc
 .IP 
 \.LP
 \.nf
-\fBsocat -u TCP4-LISTEN:3334,reuseaddr,fork \\ 
+\fBsocat \-u TCP4-LISTEN:3334,reuseaddr,fork \\ 
 OPEN:/tmp/in.log,creat,append\fP
 \.fi
 .IP 
@@ -3314,7 +3316,7 @@ through the proxy daemon listening on po
 CONNECT method, where they are authenticated as \(dq\&user\(dq\& with \(dq\&pass\(dq\& (proxyauth)\&. The proxy 
 should establish connections to host www\&.domain\&.org on port 22 then\&.
 .IP 
-.IP "\fB\f(CWsocat \- SSL:server:4443,cafile=server\&.crt,cert=client\&.pem\fP\fP"
+.IP "\fB\f(CWsocat \- OPENSSL:server:4443,cafile=server\&.crt,cert=client\&.pem\fP\fP"
 
 .IP 
 is an OpenSSL client that tries to establish a secure connection to an SSL
@@ -3328,7 +3330,7 @@ server wishes a client authentication; m
 .br 
 The first address (\(cq\&\-\(cq\&) can be replaced by almost any other socat address\&.
 .IP 
-.IP "\fB\f(CWsocat SSL\-LISTEN:4443,reuseaddr,pf=ip4,fork,cert=server\&.pem,cafile=client\&.crt PIPE\fP\fP"
+.IP "\fB\f(CWsocat OPENSSL\-LISTEN:4443,reuseaddr,pf=ip4,fork,cert=server\&.pem,cafile=client\&.crt PIPE\fP\fP"
 
 .IP 
 is an OpenSSL server that accepts TCP connections, presents the certificate
@@ -3358,7 +3360,7 @@ connection, invokes a shell\&. This shel
 connected to the TCP socket (nofork)\&.  The shell starts filan and lets it print the socket addresses to
 stderr (your terminal window)\&.
 .IP 
-.IP "\fB\f(CWecho \-e \(dq\&\e0\e14\e0\e0\ec\(dq\& |socat \-u \- file:/usr/bin/squid\&.exe,seek=0x00074420\fP\fP"
+.IP "\fB\f(CWecho \-en \(dq\&\e0\e14\e0\e0\ec\(dq\& |socat \-u \- file:/usr/bin/squid\&.exe,seek=0x00074420\fP\fP"
 
 .IP 
 functions as primitive binary editor: it writes the 4 bytes 000 014 000 000 to
@@ -3386,8 +3388,9 @@ connection)\&.
 sends a broadcast to the network 192\&.168\&.1\&.0/24 and receives the replies of the
 timeservers there\&. Ignores NTP packets from hosts outside this network\&.
 .IP 
-.IP "\fB\f(CWsocat \- SOCKET\-DATAGRAM:2:2:17:x007bxc0a80100x0000000000000000,bind=x007bx00000000x0000000000000000,setsockopt\-int=1:6:1,range=x0000xc0a80100x0000000000000000:x0000xffffff00x0000000000000000\fP\fP"
-
+.ad l
+.IP "\fB\f(CWsocat \- SOCKET\-DATAGRAM:2:2:17:x007bxc0a80100x0000000000000000,b\%ind=x007bx00000000x0000000000000000,setsockopt\-int=1:6:1,r\%ange=x0000xc0a80100x0000000000000000:x0000xffffff00x0000000000000000\fP\fP"
+.na
 .IP 
 is semantically equivalent to the previous
 example, but all parameters are
@@ -3429,8 +3432,9 @@ socat creates a PTY to make pppd happy,
 interface \f(CWhdlc0\fP, and can transfer data between
 both devices\&. Use pppd on device \f(CW/var/run/ppp\fP then\&.
 .IP 
+.ad l
 .IP "\fB\f(CWsocat \-T 1 \-d \-d TCP\-L:10081,reuseaddr,fork,crlf SYSTEM:\(dq\&echo \-e \e\(dq\&\e\e\e\(dq\&HTTP/1\&.0 200 OK\e\e\enDocumentType: text/plain\e\e\en\e\e\endate: \e$\e(date\e)\e\e\enserver:\e$SOCAT_SOCKADDR:\e$SOCAT_SOCKPORT\e\e\enclient: \e$SOCAT_PEERADDR:\e$SOCAT_PEERPORT\e\e\en\e\e\e\(dq\&\e\(dq\&; cat; echo \-e \e\(dq\&\e\e\e\(dq\&\e\e\en\e\e\e\(dq\&\e\(dq\&\(dq\&\fP\fP"
-
+.na
 .IP 
 creates a simple HTTP echo server: each HTTP client that connects gets a valid
 HTTP reply that contains information about the client address and port as it is
