Skip to content

Commit

Permalink
1.11.6
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettMayson committed Sep 18, 2024
1 parent d6af933 commit a145044
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arma-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "arma-rs"
description = "Arma 3 Extensions in Rust"
version = "1.11.5"
version = "1.11.6"
edition = "2021"
authors = ["Brett Mayson"]
repository = "https://github.com/brettmayson/arma-rs"
Expand Down
3 changes: 2 additions & 1 deletion arma-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ impl ExtensionBuilder {

#[cfg(all(not(windows), not(debug_assertions)))]
let request_context = {
let handle = unsafe { libc::dlopen(std::ptr::null(), libc::RTLD_LAZY) };
let handle =
unsafe { libc::dlopen(std::ptr::null(), libc::RTLD_NOLOAD) };
if handle.is_null() {
panic!("Failed to open handle to current process");
}
Expand Down
1 change: 1 addition & 0 deletions arma-rs/src/value/into_arma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ impl Value {
Self::Array(a) => a.is_empty(),
Self::Boolean(b) => !*b,
Self::String(s) => s.is_empty(),
_ => false,
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion arma-rs/src/value/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ pub enum Value {
/// This conversation will remove one step of escaping.
/// Example: `"My name is ""John""."` will become `My name is "John".`
String(String),
/// Unknown value. Contains the raw string.
Unknown(String),
}

impl Display for Value {
Expand All @@ -48,6 +50,7 @@ impl Display for Value {
),
Self::Boolean(b) => write!(f, "{b}"),
Self::String(s) => write!(f, "\"{}\"", s.replace('\"', "\"\"")),
Self::Unknown(s) => write!(f, "Unknown({})", s),
}
}
}
Expand All @@ -60,7 +63,7 @@ impl FromArma for Value {
Some('0'..='9') | Some('-') => Ok(Value::Number(<f64>::from_arma(s)?)),
Some('[') => Ok(Value::Array(<Vec<Value>>::from_arma(s)?)),
Some('"') => Ok(Value::String(<String>::from_arma(s)?)),
_ => Err(FromArmaError::InvalidValue(s)),
_ => Ok(Value::Unknown(s)),
}
}
}
Expand Down

0 comments on commit a145044

Please sign in to comment.