diff mbox series

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

Message ID 20201119192934.5653-1-pengfei.xu@intel.com
State Accepted
Headers show
Series lib/tst_kconfig: Fix unexpected error when checking Kconfig containing numbers | expand

Commit Message

Pengfei Xu Nov. 19, 2020, 7:29 p.m. UTC
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!
"

Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
---
 lib/tst_kconfig.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Cyril Hrubis Nov. 19, 2020, 10:01 a.m. UTC | #1
Hi!
Good catch, applied, thanks.
diff mbox series

Patch

diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
index 72830703c..8dc623952 100644
--- a/lib/tst_kconfig.c
+++ b/lib/tst_kconfig.c
@@ -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;