Switch netcat to stop parsing command line at first nonoption argument instead of...
authorRob Landley <rob@landley.net>
Wed, 14 Jan 2015 19:59:10 +0000 (13:59 -0600)
committerRob Landley <rob@landley.net>
Wed, 14 Jan 2015 19:59:10 +0000 (13:59 -0600)
Hyejin Kim tried "toyboxd nc nc -p 1234 -l rm mv ps" (which attempted to run
"nc rm mv ps") and "toybox nc -l -p 1234" (which attempted to run "-p 1234")
and found the behavior confusing. So make it work like xargs, where all
netcat options have to come before the start of any child command.

toys/other/netcat.c

index 58f0825..dcb982d 100644 (file)
@@ -5,7 +5,7 @@
  * TODO: udp, ipv6, genericize for telnet/microcom/tail-f
 
 USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_BIN))
-USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("tl^L^")"w#p#s:q#f:", TOYFLAG_BIN))
+USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("^tlL")"w#p#s:q#f:", TOYFLAG_BIN))
 
 config NETCAT
   bool "netcat"