mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 08:06:09 +00:00
Shell: Fix wrong step value for brace ranges
This fixes numeric ranges like {1..10}.
This commit is contained in:
committed by
Andreas Kling
parent
5e5eb615ec
commit
66b26fc1c2
@@ -1978,7 +1978,7 @@ RefPtr<Value> Range::run(RefPtr<Shell> shell)
|
||||
if (start_int.has_value() && end_int.has_value()) {
|
||||
auto start = start_int.value();
|
||||
auto end = end_int.value();
|
||||
auto step = start > end ? 1 : -1;
|
||||
auto step = start > end ? -1 : 1;
|
||||
for (int value = start; value != end; value += step)
|
||||
values.append(create<StringValue>(String::number(value)));
|
||||
// Append the range end too, most shells treat this as inclusive.
|
||||
|
||||
Reference in New Issue
Block a user