Improve OS Name search
This commit is contained in:
1 file changed
+7
-2
+7
-2
@@ -23,11 +23,16 @@ fn get_os() -> String {
|
||||
.map(String::from)
|
||||
.collect();
|
||||
|
||||
let os = contents[0]
|
||||
for line in &contents {
|
||||
if line.starts_with("NAME=") {
|
||||
return line
|
||||
.trim_start_matches("NAME=")
|
||||
.trim_matches('"')
|
||||
.to_string();
|
||||
return os;
|
||||
}
|
||||
}
|
||||
|
||||
return String::new();
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
|
||||
Reference in new issue
Block a user