Package: jesred / 1.2pl1-22

01-extregex Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Author: Alexander Zangerl <az@debian.org>
Subject: make all regexps extended ones

--- a/pattern_list.c
+++ b/pattern_list.c
@@ -54,7 +54,6 @@ add_to_patterns(char *pattern, pattern_i
     regex_t compiled;
     pattern_item rpattern;
     int abort_type = 0;
-    int parenthesis;
     int stored;
     
     /*  The regex_flags that we use are:
@@ -62,9 +61,9 @@ add_to_patterns(char *pattern, pattern_i
 	REG_NOSUB 
 	REG_ICASE; */
     
-    int regex_flags = REG_NOSUB;
+    int regex_flags = REG_EXTENDED;
     
-    rpattern.type = NORMAL;
+    rpattern.type = EXTENDED;
     rpattern.case_sensitive = 1;
 #ifdef USE_ACCEL   
     stored = sscanf(pattern, "%s %s %s %s", type, first, second, accel);
@@ -91,24 +90,6 @@ add_to_patterns(char *pattern, pattern_i
 	rpattern.case_sensitive = 0;
     }
     
-    if(!abort_type) {
-	parenthesis = count_parenthesis (first);
-	if (parenthesis < 0) {      
-	    /* The function returned an invalid result,
-	       indicating an invalid string */
-	    log (ERROR, "count_parenthesis() returned "
-		 "left count did not match right count for line: [%s]\n",
-		 pattern);
-	    echo_mode = 1;
-	    return;
-	}
-	else if (parenthesis > 0) {    
-	    regex_flags |= REG_EXTENDED;
-	    rpattern.type = EXTENDED;
-	    regex_flags ^= REG_NOSUB;
-	}
-    }
-  
     if(regcomp(&compiled, first, regex_flags)) {
 	log(ERROR, "Invalid regex [%s] in pattern file\n", first);
 	echo_mode = 1;