[pcre-dev] [Bug 1158] New: Spurious match for "^$"

Top Page
Delete this message
Author: Roberto Bagnara
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 1158] New: Spurious match for "^$"
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1158
           Summary: Spurious match for "^$"
           Product: PCRE
           Version: 8.13
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: bagnara@???
                CC: pcre-dev@???



$ cat r.c
#include <stdio.h>
#if PCRE
#include <pcreposix.h>
#else
#include <regex.h>
#endif

int main() {
  char buf[1024];
  regex_t re;
  int r;
  r = regcomp(&re, "^$", REG_EXTENDED);
  if (r != 0) {
    regerror(r, &re, buf, sizeof(buf));
    printf("regcomp: %s\n", buf);
  }
  r = regexec(&re, "\n", 0, 0, 0);
  if (r != 0) {
    regerror(r, &re, buf, sizeof(buf));
    printf("regexec: %s\n", buf);
  }
  return 0;
}
$ gcc -W -Wall r.c
$ ./a.out
regexec: No match
$ gcc -W -Wall -DPCRE r.c -lpcreposix
$ ./a.out 
$



--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email