From 5d769f1886c43e029e96122dae065f12e9acd485 Mon Sep 17 00:00:00 2001 From: nicknase27 Date: Wed, 7 Oct 2026 18:45:39 +0200 Subject: [PATCH] Improve OS Name search --- src/main.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5f03458..9023356 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,11 +23,16 @@ fn get_os() -> String { .map(String::from) .collect(); - let os = contents[0] - .trim_start_matches("NAME=") - .trim_matches('"') - .to_string(); - return os; + for line in &contents { + if line.starts_with("NAME=") { + return line + .trim_start_matches("NAME=") + .trim_matches('"') + .to_string(); + } + } + + return String::new(); } #[cfg(unix)]