All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] [COMMITTED] lib/tst_kconfig: Allow variables without value again
@ 2020-11-19 10:55 Cyril Hrubis
  0 siblings, 0 replies; only message in thread
From: Cyril Hrubis @ 2020-11-19 10:55 UTC (permalink / raw)
  To: ltp

Fixes: eeed458492cc ("lib/tst_kconfig: Validate variables")
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 lib/tst_kconfig.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
index 8dc623952..35f20e7a4 100644
--- a/lib/tst_kconfig.c
+++ b/lib/tst_kconfig.c
@@ -277,8 +277,13 @@ static int validate_var(const struct tst_expr_tok *var)
 	}
 
 	if (i >= var->tok_len) {
-		print_err(stderr, var, i, "Missing value");
-		return 1;
+
+		if (var->tok[i-1] == '=') {
+			print_err(stderr, var, i, "Missing value");
+			return -1;
+		}
+
+		return 0;
 	}
 
 	if (var->tok[i] == '"') {
-- 
2.26.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-19 10:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 10:55 [LTP] [PATCH] [COMMITTED] lib/tst_kconfig: Allow variables without value again Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.