From: Jaroslav Kysela Date: Thu, 31 Oct 2019 11:19:28 +0000 (+0100) Subject: htsstr: add htsstr_argsplit() test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9eaf6dc13227f712c3abc5e4987476fd83d5226;p=thirdparty%2Ftvheadend.git htsstr: add htsstr_argsplit() test --- diff --git a/src/htsstr.c b/src/htsstr.c index 4cf620631..fd598b637 100644 --- a/src/htsstr.c +++ b/src/htsstr.c @@ -286,3 +286,29 @@ htsstr_substitute(const char *src, char *dst, size_t dstlen, *dst = '\0'; return res; } + +#if 0 +/* + * gcc -g -I ../build.linux/ -o test htsstr.c + */ +void main(int argc, char *argv[]) +{ + char *strings[] = { + "sh -c '/bin/df -P -h /recordings >/config/.markers/recording-pre-process'", + "sh -c \"/bin/df -P -h /recordings >/config/.markers/recording-pre-process\"", + "bash -c '/bin/df -P -h /recordings >/config/.markers/recording-pre-process'", + "bash -c \"/bin/df -P -h /recordings | tee /config/.markers/recording-pre-process\"", + NULL, + }; + char **s = strings, **x; + while (*s) { + printf("Test for >>>%s<<<\n", *s); + x = htsstr_argsplit(*s); + while (*x) { + printf(" >%s<\n", *x); + x++; + } + s++; + } +} +#endif