compiler: fix v command to accept '.v' as valid file

pull/2297/head
Toby Webb 2019-10-12 02:03:37 +02:00 committed by Alexander Medvednikov
parent 51388fea75
commit f461a21a50
1 changed files with 1 additions and 1 deletions

View File

@ -899,7 +899,7 @@ fn new_v(args[]string) &V {
exit(1)
}
// No -o provided? foo.v => foo
if out_name == 'a.out' && dir.ends_with('.v') {
if out_name == 'a.out' && dir.ends_with('.v') && dir != '.v' {
out_name = dir.left(dir.len - 2)
}
// if we are in `/foo` and run `v .`, the executable should be `foo`