aboutsummaryrefslogtreecommitdiff
path: root/toys/lsb/seq.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-11-19 01:49:53 -0600
committerRob Landley <rob@landley.net>2012-11-19 01:49:53 -0600
commit7f909bd163630a2ce710653e0fafb7bae7171745 (patch)
treec571f2baae1faf85e239338ec875cdb615c49583 /toys/lsb/seq.c
parent6c62448f72ed9fc2b6a59ee09735283c07060cdb (diff)
downloadtoybox-7f909bd163630a2ce710653e0fafb7bae7171745.tar.gz
Teach option parsing about [groups] of related options.
Diffstat (limited to 'toys/lsb/seq.c')
-rw-r--r--toys/lsb/seq.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/toys/lsb/seq.c b/toys/lsb/seq.c
index 22e45dde..7faea185 100644
--- a/toys/lsb/seq.c
+++ b/toys/lsb/seq.c
@@ -28,12 +28,9 @@ void seq_main(void)
// Note that any non-numeric arguments are treated as zero.
first = increment = 1;
switch (toys.optc) {
- case 3:
- increment = atof(toys.optargs[1]);
- case 2:
- first = atof(*toys.optargs);
- default:
- last = atof(toys.optargs[toys.optc-1]);
+ case 3: increment = atof(toys.optargs[1]);
+ case 2: first = atof(*toys.optargs);
+ default: last = atof(toys.optargs[toys.optc-1]);
}
// Yes, we're looping on a double. Yes rounding errors can accumulate if