changeset 328:48e0f1f45181

Fix netcat -f
author Rob Landley <rob@landley.net>
date Mon, 08 Dec 2008 00:16:07 -0600
parents a50d2c0f96ed
children 6773399539aa
files toys/netcat.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
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");