mirror of
https://github.com/NotAShelf/microfetch.git
synced 2026-04-12 12:57:41 +00:00
colors: drop libc invocations for var_os
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I572acd49ef687c8049d43a7ba42bd12c6a6a6964
This commit is contained in:
parent
18a530cf64
commit
90ba703506
1 changed files with 2 additions and 2 deletions
|
|
@ -37,8 +37,8 @@ impl Colors {
|
|||
}
|
||||
|
||||
pub static COLORS: LazyLock<Colors> = LazyLock::new(|| {
|
||||
const NO_COLOR: *const libc::c_char = c"NO_COLOR".as_ptr();
|
||||
let is_no_color = unsafe { !libc::getenv(NO_COLOR).is_null() };
|
||||
// Only presence matters; value is irrelevant per the NO_COLOR spec
|
||||
let is_no_color = std::env::var_os("NO_COLOR").is_some();
|
||||
Colors::new(is_no_color)
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue