Skip to contentSkip to conversation

lib/tst_kconfig: Fix unexpected error when checking Kconfig containing numbers

PATCH New Pengfei Xu 2 participants 2 messages Nov 19, 2020 Library code

lore
Share & tools
lore

Pengfei Xu

author
#0 lore raw

PATCH 1/1 lib/tst_kconfig: Fix unexpected error when checking Kconfig containing numbers

Fix unexpected error when checking Kconfig containing numbers after commit:
eeed458492cc7dc01ad3a5fff500b09d1fda4922:"lib/tst_kconfig: Validate variables", unexpected error sample is as below:
"
CONFIG_X86_INTEL_UMIP=y

        ^

Unexpected character in variable name

CONFIG_X86_UMIP=y

        ^

Unexpected character in variable name

tst_kconfig.c:475: TBROK: Invalid kconfig variables! "

---
 lib/tst_kconfig.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/tst_kconfig.c +5 -0
index 72830703c..8dc623952 100644
@@ -262,6 +262,11 @@ static int validate_var(const struct tst_expr_tok *var)
 			continue;
 		}
 
+		if (c >= '0' && c <= '9') {
+			i++;
+			continue;
+		}
+
 		if (c == '=') {
 			i++;
 			break;
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 lib/tst_kconfig: Fix unexpected error when checking Kconfig containing numbers

Hi!
Good catch, applied, thanks.

Signature · 2 lines
Cyril Hrubis
[email protected]