Mercurial > hg > toybox
diff toys/netcat.c @ 328:48e0f1f45181
Fix netcat -f
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 08 Dec 2008 00:16:07 -0600 |
parents | 50c8afc263ee |
children | d44eb064da41 |
line wrap: on
line diff
--- a/toys/netcat.c Sun Nov 30 20:42:16 2008 -0600 +++ b/toys/netcat.c Mon Dec 08 00:16:07 2008 -0600 @@ -99,8 +99,9 @@ // The argument parsing logic can't make "<2" conditional on other // arguments like -f and -l, so we do it by hand here. - if ((toys.optflags&FLAG_f) && toys.optc!=1) toys.exithelp++; - if (!(toys.optflags&(FLAG_l|FLAG_L)) && toys.optc!=2) toys.exithelp++; + if (toys.optflags&FLAG_f) { + if (toys.optc) toys.exithelp++; + } else if (!(toys.optflags&(FLAG_l|FLAG_L)) && toys.optc!=2) toys.exithelp++; if (toys.exithelp) error_exit("Argument count wrong");