From ca3e83c2811131cfec85e9938151a91a24f2dd91 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 27 Aug 2025 21:04:31 +0200 Subject: [PATCH] zephyr-build: Allow kconfig entries with a value of zero The regex for matching numeric Kconfig values would match either numbers starting with 0x for hex, or a non-zero digit. This rejected values that were just zero. Allow this explicitly in the regex. Signed-off-by: David Brown --- zephyr-build/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr-build/src/lib.rs b/zephyr-build/src/lib.rs index 4c248125..85ba339b 100644 --- a/zephyr-build/src/lib.rs +++ b/zephyr-build/src/lib.rs @@ -54,7 +54,7 @@ pub fn build_kconfig_mod() { // The assumption is that hex values are unsigned, and decimal are signed. let config_hex = Regex::new(r"^(CONFIG_.*)=(0x[0-9a-fA-F]+)$").unwrap(); - let config_int = Regex::new(r"^(CONFIG_.*)=(-?[1-9][0-9]*)$").unwrap(); + let config_int = Regex::new(r"^(CONFIG_.*)=(-?[1-9][0-9]*|0)$").unwrap(); // It is unclear what quoting might be used in the .config. let config_str = Regex::new(r#"^(CONFIG_.*)=(".*")$"#).unwrap(); let gen_path = Path::new(&outdir).join("kconfig.rs");