mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
doctor: protect against malformed /etc/os-release files on linux
This commit is contained in:
parent
f66dcbe6e5
commit
fe8cf19a8f
@ -131,7 +131,9 @@ fn (mut a App) get_linux_os_name() string {
|
|||||||
mut vals := map[string]string
|
mut vals := map[string]string
|
||||||
for line in lines {
|
for line in lines {
|
||||||
x := line.split('=')
|
x := line.split('=')
|
||||||
vals[x[0]] = x[1].trim('"')
|
if x.len > 1 {
|
||||||
|
vals[x[0]] = x[1].trim('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if vals['PRETTY_NAME'] == '' {
|
if vals['PRETTY_NAME'] == '' {
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user