From 0a5f58309d4c27aa218205bacb34018d794524a4 Mon Sep 17 00:00:00 2001 From: Tarcisio Gruppi Date: Sun, 25 Apr 2021 15:03:18 -0300 Subject: [PATCH] Updated Process.arguments to only return slice if arg count >= 2 (#61) --- src/module/os.wren | 2 +- src/module/os.wren.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module/os.wren b/src/module/os.wren index 05cc645a..4c731c2b 100644 --- a/src/module/os.wren +++ b/src/module/os.wren @@ -7,7 +7,7 @@ class Platform { class Process { // TODO: This will need to be smarter when wren supports CLI options. - static arguments { allArguments[2..-1] } + static arguments { allArguments.count >= 2 ? allArguments[2..-1] : [] } foreign static allArguments foreign static version diff --git a/src/module/os.wren.inc b/src/module/os.wren.inc index 29094989..cdc18167 100644 --- a/src/module/os.wren.inc +++ b/src/module/os.wren.inc @@ -9,7 +9,7 @@ static const char* osModuleSource = "\n" "class Process {\n" " // TODO: This will need to be smarter when wren supports CLI options.\n" -" static arguments { allArguments[2..-1] }\n" +" static arguments { allArguments.count >= 2 ? allArguments[2..-1] : [] }\n" "\n" " foreign static allArguments\n" " foreign static version\n"