summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko2023-04-11 20:29:59 +0200
committerDenys Vlasenko2023-04-11 20:29:59 +0200
commit478b5ac2bcdb5014d8e6a6e8d7647b4c599cc1a7 (patch)
treef4d1752749ae697f126e02e51e0b1e2f6b8ba464 /coreutils
parentcb57abb46f06f4ede8d9ccbdaac67377fdf416cf (diff)
downloadbusybox-478b5ac2bcdb5014d8e6a6e8d7647b4c599cc1a7.zip
busybox-478b5ac2bcdb5014d8e6a6e8d7647b4c599cc1a7.tar.gz
seq: fix yet another case of negative parameters not working
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/seq.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/coreutils/seq.c b/coreutils/seq.c
index c0e2d1e..77a8aba 100644
--- a/coreutils/seq.c
+++ b/coreutils/seq.c
@@ -57,8 +57,12 @@ int seq_main(int argc, char **argv)
saved = argv[++n];
if (!saved)
break;
- if (saved[0] != '-')
- break;
+ if (saved[0] != '-') {
+ // break; // "seq -s : -1 1" won't be treated correctly
+ continue;
+ }
+// "seq -s -1 1 9" is not treated correctly, but such usage
+// (delimiter string which looks like negative number) is very unlikely
c = saved[1];
if (c == '.' || (c >= '0' && c <= '9')) {
argv[n] = NULL;