From ebb0813089c7bcc8e23b7921a77dc5b2d0d02709 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 5 Jul 2017 13:20:21 -0400 Subject: [PATCH] lib: warn about too much docstring Signed-off-by: Quentin Young --- lib/command_parse.y | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/command_parse.y b/lib/command_parse.y index 3337481094..ba042c33be 100644 --- a/lib/command_parse.y +++ b/lib/command_parse.y @@ -443,6 +443,14 @@ terminate_graph (CMD_YYLTYPE *locp, struct parser_ctx *ctx, struct graph_node *end_element_node = graph_new_node (ctx->graph, element, NULL); + if (ctx->docstr && strlen (ctx->docstr) > 1) { + zlog_debug ("Excessive docstring while parsing '%s'", ctx->el->string); + zlog_debug ("----------"); + while (ctx->docstr && ctx->docstr[1] != '\0') + zlog_debug ("%s", strsep(&ctx->docstr, "\n")); + zlog_debug ("----------\n"); + } + graph_add_edge (finalnode, end_token_node); graph_add_edge (end_token_node, end_element_node); }