help-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: subjects not being parsed?


From: Andrew Gray
Subject: Re: subjects not being parsed?
Date: Fri, 8 Mar 2002 09:04:32 +1100

Hi Chad,

> Using the modified regular expression and re_search will match Subject
> lines such as the following:
> 
> gnats/85
> Re: gnats/85
> FW: RE: gnats/85
> 
> Here is the patchfile to make these changes:

Sorry, I hadn't tested that patch completely and found a bug I had
introduced with my changes. This is a better patchfile:

Index: file-pr.c
===================================================================
RCS file: /cvsroot/gnats/gnats/gnats/file-pr.c,v
retrieving revision 1.45
diff -u -p -r1.45 file-pr.c
--- file-pr.c   10 Feb 2002 18:23:42 -0000      1.45
+++ file-pr.c   7 Mar 2002 21:53:58 -0000
@@ -594,15 +594,16 @@ checkIfReply (PR *pr, ErrorDesc *err)
   regex.translate = case_fold;
   
   {
-    const char *const PAT = "\\<((PR[ \t/])|([-a-z0-9_+.]+)/)([0-9]+)";
+    const char *const PAT = "\\<((PR[ \t/])\\|([-a-z0-9_+.]+)/)([0-9]+)";
     re_compile_pattern (PAT, strlen (PAT), &regex);
   }
-  i = re_match (&regex, headerValue, strlen (headerValue), 0, &regs);
+  i = re_search (&regex, headerValue, strlen (headerValue), 0,
+                strlen (headerValue), &regs);
   regex.translate = NULL;
   regfree (&regex);
   re_set_syntax (old_syntax);
 
-  if (i <= 0)
+  if (i < 0)
     {
       return NULL;
     }

Regards,

Andrew Gray



reply via email to

[Prev in Thread] Current Thread [Next in Thread]