We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 077e948 commit cf3f0f9Copy full SHA for cf3f0f9
tests/seq.sh
@@ -3,6 +3,9 @@
3
set -eux
4
5
set -- \
6
+ '0' \
7
+ '0 0' \
8
+ '0 0 0' \
9
'10' \
10
'5 10' \
11
'0 2 10' \
userland/utilities/seq.py
@@ -59,9 +59,12 @@ def arg_to_decimal(arg: str) -> Decimal:
59
exponent: int
60
61
if len(args) == 1:
62
+ last = arg_to_decimal(args[0])
63
+ if not last:
64
+ return 0
65
+
66
first = Decimal(1)
67
increment = Decimal(1)
- last = arg_to_decimal(args[0])
68
exponent = 0
69
elif len(args) == 2:
70
first = arg_to_decimal(args[0])
@@ -81,6 +84,9 @@ def arg_to_decimal(arg: str) -> Decimal:
81
84
else increment
82
85
)
83
86
87
+ if not increment:
88
+ parser.error(f"invalid zero increment value: '{increment}'")
89
90
formatstr: str
91
92
if opts.equal_width:
0 commit comments