aboutsummaryrefslogtreecommitdiff
path: root/editors/awk.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-16 19:07:53 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-16 19:07:53 +0200
commita1799db4ac660a15285e1ac2464b5f622746d787 (patch)
tree3cdbba58ebc8d20aa20c3dcb571498c1386b2dd9 /editors/awk.c
parente440b39416e7876129e619f7aa6935c783020645 (diff)
downloadbusybox-a1799db4ac660a15285e1ac2464b5f622746d787.tar.gz
awk: stop on first non-option, closes 9861
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors/awk.c')
-rw-r--r--editors/awk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 372a255bd..2005329ad 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:"