diff src/context.cpp @ 170:bd33eaccfed8

fix pre/post scripts in rpm spec file
author carl
date Thu, 30 Aug 2007 14:07:09 -0700
parents 6bac960af6b4
children 83fe0be032c1
line wrap: on
line diff
--- a/src/context.cpp	Thu Aug 30 12:05:44 2007 -0700
+++ b/src/context.cpp	Thu Aug 30 14:07:09 2007 -0700
@@ -697,7 +697,7 @@
 		// delete the underlying DNSBL objects.
 		delete d;
 	}
-	if (generic_regx && strlen(generic_regx)) regfree(&generic_pattern);
+	if (generic_regx) regfree(&generic_pattern);
 }
 
 
@@ -719,10 +719,10 @@
 bool CONTEXT::set_generic(char *regx, char *msg)
 {
 	int rc = 0;
-	if (generic_regx && strlen(generic_regx)) regfree(&generic_pattern);
+	if (generic_regx) regfree(&generic_pattern);
 	generic_regx	= regx;
 	generic_message = msg;
-	if (generic_regx && strlen(generic_regx)) {
+	if (generic_regx) {
 		rc = regcomp(&generic_pattern, regx, REG_NOSUB | REG_ICASE | REG_EXTENDED);
 	}
 	return rc;	// true iff bad pattern
@@ -732,7 +732,7 @@
 char *CONTEXT::generic_match(char *client)
 {
 	if (parent && !generic_regx) return parent->generic_match(client);
-	if (!strlen(generic_regx))	 return NULL;
+	if (!generic_regx)			 return NULL;
 	if (0 == regexec(&generic_pattern, client, 0, NULL, 0)) {
 		return generic_message;
 	}