From dcb52f7c9a01a0609a7d4f00256f6807ae49320b Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 8 Dec 2008 00:16:07 -0600 Subject: Fix netcat -f --- toys/netcat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toys/netcat.c b/toys/netcat.c index 82039a91..1b51337e 100644 --- a/toys/netcat.c +++ b/toys/netcat.c @@ -99,8 +99,9 @@ void netcat_main(void) // 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"); -- cgit v1.2.3