From fe249cd1f801c5b87d5033b404a55c5d0b68a5c2 Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 25 May 2020 12:30:12 +0200 Subject: [PATCH] pref: fix crash in 'v run' without arguments --- vlib/v/pref/pref.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/v/pref/pref.v b/vlib/v/pref/pref.v index 82a3a82c9f..057f93cf9f 100644 --- a/vlib/v/pref/pref.v +++ b/vlib/v/pref/pref.v @@ -271,7 +271,7 @@ pub fn parse_args(args []string) (&Preferences, string) { res.path = command } else if command == 'run' { res.is_run = true - if command_pos > args.len { + if command_pos + 2 > args.len { eprintln('v run: no v files listed') exit(1) }