From 66b26fc1c24b38f78502c8cbcbc85d044a55797e Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Tue, 29 Dec 2020 17:28:46 +0330 Subject: Shell: Fix wrong step value for brace ranges This fixes numeric ranges like {1..10}. --- Shell/AST.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shell/AST.cpp b/Shell/AST.cpp index 2bd877624d..f599e74d97 100644 --- a/Shell/AST.cpp +++ b/Shell/AST.cpp @@ -1978,7 +1978,7 @@ RefPtr Range::run(RefPtr 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(String::number(value))); // Append the range end too, most shells treat this as inclusive. -- cgit v1.2.3