SysArchMeter: skip "n/a" values

Unavailable values are returned as "n/a" from lsb_release, skip these.

$ lsb_release -a
LSB Version:    1.4
Distributor ID: Arch
Description:    Arch Linux
Release:        rolling
Codename:       n/a
This commit is contained in:
Christian Hesse 2021-02-04 13:26:39 +01:00
parent 8fb51627b2
commit 85a855f5b2

View File

@ -38,6 +38,11 @@ static void SysArchMeter_updateValues(Meter* this, char* buffer, size_t size) {
char* value = String_trim(&line[n + 1]);
line[n] = '\0';
if(String_eq(value, "n/a")) {
free(value);
continue;
}
if(String_eq(line, "Distributor ID"))
snprintf(distro[0], sizeof(distro[0]), "%s", value);
else if(String_eq(line, "Release"))