lfreist / hwinfo

cross platform C++ library for hardware information (CPU, RAM, GPU, ...)
MIT License
433 stars 74 forks source link

Fixed OS version querying on Linux #72

Closed Agamenon-sama closed 9 months ago

Agamenon-sama commented 9 months ago

OS version querying on Linux works by reading the property that starts with VERSION in the file /etc/os-release. My Ubuntu system however contains the following in that file

VERSION_ID="23.04"
VERSION="23.04 (Lunar Lobster)"
VERSION_CODENAME=lunar

This causes the version number to be set to una which is the value of the last property that starts with VERSION minus the first and last character.

I also suggest applying a similar fix for all situations where we read from this file or a similar one to avoid future issues.