From fe8cf19a8f8c4399d81eeb841876c788fa3d658b Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 21 Sep 2020 22:38:58 +0300 Subject: [PATCH] doctor: protect against malformed /etc/os-release files on linux --- cmd/tools/vdoctor.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/tools/vdoctor.v b/cmd/tools/vdoctor.v index 084a8f33ed..0cd38008de 100644 --- a/cmd/tools/vdoctor.v +++ b/cmd/tools/vdoctor.v @@ -131,7 +131,9 @@ fn (mut a App) get_linux_os_name() string { mut vals := map[string]string for line in lines { x := line.split('=') - vals[x[0]] = x[1].trim('"') + if x.len > 1 { + vals[x[0]] = x[1].trim('"') + } } if vals['PRETTY_NAME'] == '' { continue