#! /bin/sh /usr/share/dpatch/dpatch-run
## 200-cmp-operators-fix.dpatch by  <joe@sv04>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad radiusd~/src/main/valuepair.c radiusd/src/main/valuepair.c
--- radiusd~/src/main/valuepair.c	2008-07-20 15:35:53.000000000 -0400
+++ radiusd/src/main/valuepair.c	2008-07-20 15:36:07.000000000 -0400
@@ -155,10 +155,9 @@
 		compare = regexec(&reg, value,  REQUEST_MAX_REGEX + 1,
 				  rxmatch, 0);
 		regfree(&reg);
-
-		if (compare != 0) return 0;
-		return -1;
-
+		/* !~ only succeeds if NO matches are found in reply pair */
+		if (compare == 0) return -1;
+		ret = -1; /*check the rest for no match */
 	}
 #endif
 
@@ -432,7 +431,12 @@
 			 *	Didn't find it.  If we were *trying*
 			 *	to not find it, then we succeeded.
 			 */
-			if (check_item->operator == T_OP_CMP_FALSE)
+			if (check_item->operator == T_OP_CMP_FALSE ||
+#ifdef HAVE_REGEX_H
+			    check_item->operator == T_OP_REG_NE ||
+#endif
+			    check_item->operator == T_OP_NE 
+			    )
 				continue;
 			else
 				return -1;
