From 1e969d75b2e68f8cf347b825f004fca8dcfd003e Mon Sep 17 00:00:00 2001 From: Ryan Thomas McBride Date: Tue, 7 Nov 2006 06:16:57 +0000 Subject: Only try to recursively print rules if they are actually anchors. --- sbin/pfctl/pfctl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sbin') diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index d3c2fc1e32e..e9e96ead821 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl.c,v 1.255 2006/11/07 01:12:01 mcbride Exp $ */ +/* $OpenBSD: pfctl.c,v 1.256 2006/11/07 06:16:56 mcbride Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -755,9 +755,10 @@ pfctl_show_rules(int dev, char *path, int opts, int format, if (pr.rule.label[0] && (opts & PF_OPT_SHOWALL)) labels = 1; INDENT(depth, !(opts & PF_OPT_VERBOSE)); - if ((((p = strrchr(pr.anchor_call, '_')) != NULL) && + if (pr.anchor_call[0] && + ((((p = strrchr(pr.anchor_call, '_')) != NULL) && ((void *)p == (void *)pr.anchor_call || - *(--p) == '/')) || opts & PF_OPT_RECURSE) { + *(--p) == '/')) || opts & PF_OPT_RECURSE)) { brace++; if ((p = strrchr(pr.anchor_call, '/')) != NULL) -- cgit v1.2.3