]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsstr: add htsstr_argsplit() test
authorJaroslav Kysela <perex@perex.cz>
Thu, 31 Oct 2019 11:19:28 +0000 (12:19 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 31 Oct 2019 11:19:28 +0000 (12:19 +0100)
src/htsstr.c

index 4cf62063130b980e42338def999f4e0f4e061cad..fd598b637a05bdffdebb1b22ff1f091a3b6005cc 100644 (file)
@@ -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