mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
pref: fix access in invalid position on v search ''
(#13993)
This commit is contained in:
parent
473bc0254d
commit
3571f66a82
@ -110,7 +110,7 @@ pub mut:
|
||||
test_runner string // can be 'simple' (fastest, but much less detailed), 'tap', 'normal'
|
||||
profile_file string // the profile results will be stored inside profile_file
|
||||
profile_no_inline bool // when true, [inline] functions would not be profiled
|
||||
profile_fns []string // when set, profiling will be off by default, but inside these functions (and what they call) it will be on.
|
||||
profile_fns []string // when set, profiling will be off by default, but inside these functions (and what they call) it will be on.
|
||||
translated bool // `v translate doom.v` are we running V code translated from C? allow globals, ++ expressions, etc
|
||||
is_prod bool // use "-O2"
|
||||
obfuscate bool // `v -obf program.v`, renames functions to "f_XXX"
|
||||
@ -634,7 +634,7 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
|
||||
eprintln('Use `v $arg` instead.')
|
||||
exit(1)
|
||||
}
|
||||
if arg[0] == `-` {
|
||||
if arg.len != 0 && arg[0] == `-` {
|
||||
if arg[1..] in pref.list_of_flags_with_param {
|
||||
// skip parameter
|
||||
i++
|
||||
|
8
vlib/v/pref/pref_test.v
Normal file
8
vlib/v/pref/pref_test.v
Normal file
@ -0,0 +1,8 @@
|
||||
module pref
|
||||
|
||||
fn test_check_parametes() {
|
||||
// reproducing issue https://github.com/vlang/v/issues/13983
|
||||
_, cmd := parse_args_and_show_errors(['help'], [''], true)
|
||||
// no command found from args
|
||||
assert cmd == ''
|
||||
}
|
Loading…
Reference in New Issue
Block a user