Skip to content

Commit 49a4289

Browse files
committed
zephyr-build: Allow kconfig entires 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 <[email protected]>
1 parent 161825c commit 49a4289

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zephyr-build/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn build_kconfig_mod() {
5454

5555
// The assumption is that hex values are unsigned, and decimal are signed.
5656
let config_hex = Regex::new(r"^(CONFIG_.*)=(0x[0-9a-fA-F]+)$").unwrap();
57-
let config_int = Regex::new(r"^(CONFIG_.*)=(-?[1-9][0-9]*)$").unwrap();
57+
let config_int = Regex::new(r"^(CONFIG_.*)=(-?[1-9][0-9]*|0)$").unwrap();
5858
// It is unclear what quoting might be used in the .config.
5959
let config_str = Regex::new(r#"^(CONFIG_.*)=(".*")$"#).unwrap();
6060
let gen_path = Path::new(&outdir).join("kconfig.rs");

0 commit comments

Comments
 (0)