compiler: option/command parsing bugfix

pull/3124/head
Delyan Angelov 2019-12-17 15:00:10 +02:00 committed by Alexander Medvednikov
parent 37add98043
commit ba519f105a
1 changed files with 6 additions and 2 deletions

View File

@ -1126,9 +1126,13 @@ pub fn new_v(args[]string) &V {
}
}
fn non_empty(a []string) []string {
return a.filter(it.len != 0)
}
pub fn env_vflags_and_os_args() []string {
vosargs := os.getenv('VOSARGS')
if '' != vosargs { return vosargs.split(' ') }
if '' != vosargs { return non_empty(vosargs.split(' ')) }
mut args := []string
vflags := os.getenv('VFLAGS')
@ -1141,7 +1145,7 @@ pub fn env_vflags_and_os_args() []string {
} else{
args << os.args
}
return args
return non_empty(args)
}
pub fn vfmt(args[]string) {