Commit d31dcecf authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make it possible to supress all or no lines of output



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3416 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent d4adf41c
......@@ -59,7 +59,7 @@ sub_vlu(void *priv, const char *str)
sp = priv;
if (!sp->lines++)
vsb_printf(sp->sb, "Message from %s:\n", sp->name);
if (sp->maxlines > 0 && sp->lines <= sp->maxlines)
if (sp->maxlines < 0 || sp->lines <= sp->maxlines)
vsb_printf(sp->sb, "%s\n", str);
return (0);
}
......@@ -108,7 +108,7 @@ SUB_run(struct vsb *sb, sub_func_f *func, void *priv, const char *name, int maxl
continue;
AZ(close(p[0]));
VLU_Destroy(vlu);
if (sp.lines > sp.maxlines)
if (sp.maxlines >= 0 && sp.lines > sp.maxlines)
vsb_printf(sb, "[%d lines truncated]\n",
sp.lines - sp.maxlines);
do {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment