[LTP] [PATCH 1/9] metadata: metaparse: Parse operators *, +, and | properly

Cyril Hrubis chrubis@suse.cz
Wed Dec 18 20:00:21 CET 2024


This is needed for cases where we assing integer values to tst_test
structure members such as:

TST_SR_SKIP_MISSING|TST_SR_TCONF flags in .save_restore
(1*TST_MB) in .min_swap_avail
[N+1, "TST_NEEDS"] in .hugepages

etc.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 metadata/metaparse.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/metadata/metaparse.c b/metadata/metaparse.c
index 2384c73c8..bf9559712 100644
--- a/metadata/metaparse.c
+++ b/metadata/metaparse.c
@@ -173,6 +173,9 @@ static char *next_token2(FILE *f, char *buf, size_t buf_len, struct data_node *d
 		case '[':
 		case ']':
 		case '#':
+		case '|':
+		case '+':
+		case '*':
 			if (i) {
 				ungetc(c, f);
 				goto exit;
-- 
2.45.2



More information about the ltp mailing list