#! /bin/sh /usr/share/dpatch/dpatch-run
## 140-rlm-policy-subops.dpatch by  <joe@nameserver3.ttec.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad --exclude=CVS --exclude=.svn ./src/modules/rlm_policy/evaluate.c /tmp/dpep-work.HBL4sz/freeradius-1.1.0/src/modules/rlm_policy/evaluate.c
--- ./src/modules/rlm_policy/evaluate.c	2005-10-13 20:41:47.000000000 -0400
+++ /tmp/dpep-work.HBL4sz/freeradius-1.1.0/src/modules/rlm_policy/evaluate.c	2005-10-13 20:52:12.000000000 -0400
@@ -814,6 +814,19 @@
 	case POLICY_LEX_PLUS_EQUALS:
 		operator = T_OP_ADD;
 		break;
+		
+	case POLICY_LEX_MINUS_EQUALS:
+		operator = T_OP_SUB;
+		break;
+		
+	case POLICY_LEX_MINUS_TRUE:
+		operator = T_OP_SUB_ALL; 
+		break;
+		
+	case POLICY_LEX_RX_MINUS:
+		operator = T_OP_SUB_REG;
+		break;
+	
 	
 	default:
 		fprintf(stderr, "Expected '=' for operator, not '%s' at line %d\n",
@@ -898,12 +911,12 @@
 		break;
 
 	case POLICY_LEX_ASSIGN: /* 'union' */
-		pairmove(vps, &head);
+		pairxlatmove(NULL, vps, &head);
 		pairfree(&head);
 		break;
 
 	case POLICY_LEX_CONCAT_EQUALS:
-		pairadd(vps, head);
+		pairxlatmove(NULL, vps, &head);
 		break;
 
 	default:
diff -urNad --exclude=CVS --exclude=.svn ./src/modules/rlm_policy/parse.c /tmp/dpep-work.HBL4sz/freeradius-1.1.0/src/modules/rlm_policy/parse.c
--- ./src/modules/rlm_policy/parse.c	2005-10-13 20:41:47.000000000 -0400
+++ /tmp/dpep-work.HBL4sz/freeradius-1.1.0/src/modules/rlm_policy/parse.c	2005-10-13 20:52:15.000000000 -0400
@@ -106,6 +106,9 @@
 	{ "!~", POLICY_LEX_RX_NOT_EQUALS },
 	{ ".=", POLICY_LEX_CONCAT_EQUALS },
 	{ ":=", POLICY_LEX_SET_EQUALS },
+	{ "-=", POLICY_LEX_MINUS_EQUALS },
+	{ "-*", POLICY_LEX_MINUS_TRUE },
+	{ "-~", POLICY_LEX_RX_MINUS },
 	{ "double quoted string", POLICY_LEX_DOUBLE_QUOTED_STRING },
 	{ "single quoted string", POLICY_LEX_SINGLE_QUOTED_STRING },
 	{ "back quoted string", POLICY_LEX_BACK_QUOTED_STRING },
@@ -190,6 +193,16 @@
 			*token = POLICY_LEX_MINUS_EQUALS;
 			input++;
 			break;
+			
+		case '*':
+			*token = POLICY_LEX_MINUS_TRUE;
+			input++;
+			break;
+
+		case '~':
+			*token = POLICY_LEX_RX_MINUS;
+			input++;
+			break;
 
 		default:
 			*token = POLICY_LEX_MINUS;
@@ -1231,6 +1244,9 @@
 	case POLICY_LEX_AND_EQUALS:
 	case POLICY_LEX_OR_EQUALS:
 	case POLICY_LEX_PLUS_EQUALS:
+	case POLICY_LEX_MINUS_EQUALS:
+	case POLICY_LEX_MINUS_TRUE:
+	case POLICY_LEX_RX_MINUS:
 		break;
 
 	default:
diff -urNad --exclude=CVS --exclude=.svn ./src/modules/rlm_policy/rlm_policy.h /tmp/dpep-work.HBL4sz/freeradius-1.1.0/src/modules/rlm_policy/rlm_policy.h
--- ./src/modules/rlm_policy/rlm_policy.h	2005-10-13 20:41:47.000000000 -0400
+++ /tmp/dpep-work.HBL4sz/freeradius-1.1.0/src/modules/rlm_policy/rlm_policy.h	2005-10-13 20:52:02.000000000 -0400
@@ -37,6 +37,7 @@
 
 #include "rad_assert.h"
 
+
 /*
  *	Internal lexer.
  */
@@ -74,6 +75,8 @@
 	POLICY_LEX_OR_EQUALS,	/* |= */
 	POLICY_LEX_PLUS_EQUALS,	/* += */
 	POLICY_LEX_MINUS_EQUALS, /* -= */
+	POLICY_LEX_MINUS_TRUE, /* -* */
+	POLICY_LEX_RX_MINUS, /* -~*/
 	POLICY_LEX_CONCAT_EQUALS, /* .= */
 	POLICY_LEX_VARIABLE,	/* %{foo} */
 	POLICY_LEX_FUNCTION,	/* Hmmm... */
