diff options
author | David Hankins <dhankins@isc.org> | 2007-06-07 15:52:30 +0000 |
---|---|---|
committer | David Hankins <dhankins@isc.org> | 2007-06-07 15:52:30 +0000 |
commit | dd3282251eb1d2ea411d09f0ccdb079a891aa4ce (patch) | |
tree | c5f07e7d3b56b32a6a74c6c380f0325ab79fdf67 /common/print.c | |
parent | a546f2a714b15049860d0cb60a6e8e2ea8ee7418 (diff) | |
download | isc-dhcp-dd3282251eb1d2ea411d09f0ccdb079a891aa4ce.tar.gz |
- Two new operators, ~= and ~~, have been integrated to implement
boolean matches by regular expression (such as may be used in
class matching statements). Thanks to a patch by Alexandr S.
Agranovsky, which underwent slight modification. [ISC-Bugs #8155]
Diffstat (limited to 'common/print.c')
-rw-r--r-- | common/print.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/common/print.c b/common/print.c index e9a64632..51ce2d30 100644 --- a/common/print.c +++ b/common/print.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: print.c,v 1.66 2007/05/29 18:11:55 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n"; +"$Id: print.c,v 1.67 2007/06/07 15:52:29 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -517,6 +517,21 @@ static unsigned print_subexpression (expr, buf, len) } break; + case expr_regex_match: + if (len > 10) { + rv = 4; + strcpy(buf, "(regex "); + rv += print_subexpression(expr->data.equal[0], + buf + rv, len - rv - 2); + buf[rv++] = ' '; + rv += print_subexpression(expr->data.equal[1], + buf + rv, len - rv - 1); + buf[rv++] = ')'; + buf[rv] = 0; + return rv; + } + break; + case expr_substring: if (len > 11) { rv = 8; |