All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] docparse: Replace \t with space
@ 2021-01-21 13:00 Petr Vorel
  2021-01-21 13:00 ` [LTP] [PATCH 2/2] testinfo.pl: Optimize imports Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Petr Vorel @ 2021-01-21 13:00 UTC (permalink / raw)
  To: ltp

to avoid constant failures because tabs are forbidden in JSON.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,

Currently required for "Convert CAN tests to new LTP API" patchset
https://patchwork.ozlabs.org/project/ltp/patch/20210120143723.26483-5-rpalethorpe@suse.com/
https://patchwork.ozlabs.org/project/ltp/patch/20210120143723.26483-6-rpalethorpe@suse.com/

Kind regards,
Petr

 docparse/data_storage.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/docparse/data_storage.h b/docparse/data_storage.h
index ef420c08f..99c2514b7 100644
--- a/docparse/data_storage.h
+++ b/docparse/data_storage.h
@@ -54,6 +54,7 @@ static inline struct data_node *data_node_string(const char *string)
 {
 	size_t size = sizeof(struct data_node_string) + strlen(string) + 1;
 	struct data_node *node = malloc(size);
+	char *ix = node->string.val;
 
 	if (!node)
 		return NULL;
@@ -61,6 +62,9 @@ static inline struct data_node *data_node_string(const char *string)
 	node->type = DATA_STRING;
 	strcpy(node->string.val, string);
 
+	while ((ix = strchr(ix, '\t')))
+		*ix++ = ' ';
+
 	return node;
 }
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-01-28 14:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-21 13:00 [LTP] [PATCH 1/2] docparse: Replace \t with space Petr Vorel
2021-01-21 13:00 ` [LTP] [PATCH 2/2] testinfo.pl: Optimize imports Petr Vorel
2021-01-28 14:53   ` Petr Vorel
2021-01-21 13:05 ` [LTP] [PATCH 1/2] docparse: Replace \t with space Petr Vorel
2021-01-21 14:47 ` Richard Palethorpe
2021-01-21 14:50   ` Cyril Hrubis
2021-01-21 15:43     ` Petr Vorel
2021-01-21 15:59       ` Richard Palethorpe
2021-01-21 16:20         ` Petr Vorel
2021-01-21 16:28           ` 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.