From 7155fe3041b0c15ade71efe754f55e563500ae3f Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sat, 27 Jan 2024 23:50:10 +0100 Subject: [PATCH] Add whitespace to compiler flags in long version string --- src/bin/common.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bin/common.rs b/src/bin/common.rs index 0fc106b4ae..b3118baf48 100644 --- a/src/bin/common.rs +++ b/src/bin/common.rs @@ -273,10 +273,14 @@ fn get_version() -> &'static str { fn get_long_version() -> &'static str { static LONG_VERSION_STR: Lazy = Lazy::new(|| { - let mut rustflags = env!("CARGO_ENCODED_RUSTFLAGS"); - if rustflags.trim().is_empty() { - rustflags = "(None)"; - } + let rustflags = env!("CARGO_ENCODED_RUSTFLAGS"); + let rustflags = if rustflags.trim().is_empty() { + "(None)".to_string() + } else { + // Replace non-printable ASCII Unit Separator with whitespace + rustflags.replace(0x1F as char, " ") + }; + format!( "{}\n{} {}\nCompiled CPU Features: {}\nRuntime Assembly Support: {}{}\nThreading: {}\nUnstable Features: {}\nCompiler Flags: {}", get_version(),