Skip to content

Commit

Permalink
Fix CC_FORCE_DISABLE=0 evaluating to true (#1371)
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm authored Jan 17, 2025
1 parent d2dc6a9 commit cf39286
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4157,10 +4157,9 @@ fn is_disabled() -> bool {
match std::env::var_os("CC_FORCE_DISABLE") {
// Not set? Not disabled.
None => false,
// Respect `CC_FORCE_DISABLE=0` and some simple synonyms.
Some(v) if &*v != "0" && &*v != "false" && &*v != "no" => false,
// Otherwise, we're disabled. This intentionally includes `CC_FORCE_DISABLE=""`
Some(_) => true,
// Respect `CC_FORCE_DISABLE=0` and some simple synonyms, otherwise
// we're disabled. This intentionally includes `CC_FORCE_DISABLE=""`
Some(v) => &*v != "0" && &*v != "false" && &*v != "no",
}
}
match val {
Expand Down

0 comments on commit cf39286

Please sign in to comment.