summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2017-08-16 19:07:53 +0200
committerDenys Vlasenko2017-08-16 19:07:53 +0200
commita1799db4ac660a15285e1ac2464b5f622746d787 (patch)
tree3cdbba58ebc8d20aa20c3dcb571498c1386b2dd9
parente440b39416e7876129e619f7aa6935c783020645 (diff)
downloadbusybox-a1799db4ac660a15285e1ac2464b5f622746d787.zip
busybox-a1799db4ac660a15285e1ac2464b5f622746d787.tar.gz
awk: stop on first non-option, closes 9861
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/awk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 372a255..2005329 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -70,7 +70,11 @@
#endif
-#define OPTSTR_AWK \
+/* "+": stop on first non-option:
+ * $ awk 'BEGIN { for(i=1; i<ARGC; ++i) { print i ": " ARGV[i] }}' -argz
+ * 1: -argz
+ */
+#define OPTSTR_AWK "+" \
"F:v:*f:*" \
IF_FEATURE_AWK_GNU_EXTENSIONS("e:*") \
"W:"