diff --git a/statements/pbrst-cli.c b/statements/pbrst-cli.c index 9b086e0..643ec64 100644 --- a/statements/pbrst-cli.c +++ b/statements/pbrst-cli.c @@ -105,6 +105,7 @@ int main(int ac, char **av) } if (graphviz) { char *g_start = strstr(parseinfo, "diagram: graphviz: start\n"); + if (g_start == NULL) exit(0); // empty output g_start = strstr(g_start, "\n"); g_start++; char *g_end = strstr(parseinfo, "diagram: graphviz: end"); diff --git a/statements/tests/runme-graphviz b/statements/tests/runme-graphviz new file mode 100755 index 0000000..434e24c --- /dev/null +++ b/statements/tests/runme-graphviz @@ -0,0 +1,21 @@ +#!/bin/bash + +# This test assumes that pbrst-cli has already been compiled. +# It creates an HTML file with embedded SVG images. + +HTML=graphviz.html +echo "