This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

regcomp problem with 2.1.3



Hi all,

Andreas Hartmann reported a problem with regular expressions in glibc
2.1.3.  He's written a small program to show the problem which I just
polished up a little bit.


The appended program gives the following error:
$ ./a.out 
<13>
<Invalid preceding regular expression>

Removing either of the RE_ options results in correct behaviour, but
the combination of both RE_BACKSLASH_ESCAPE_IN_LISTS and
RE_CONTEXT_INDEP_ANCHORS leads to an error in regcomp.

Could somebody please investigate what's wrong here?

Thanks,
Andreas

#include <ctype.h>
#include <regex.h>
#include <stdio.h>
#include <malloc.h>

int
main (void)
{
  regex_t *preg;
  int ret;

  preg = calloc(1, sizeof(regex_t));

  if((ret = regcomp(preg, "*.ANF", RE_BACKSLASH_ESCAPE_IN_LISTS|RE_CONTEXT_INDEP_ANCHORS)) != 0)
    {
      char errmsg[200];

      printf ("<%d>\n",ret);

      regerror(ret, preg, errmsg, 200);
      regfree(preg);

      printf ("<%s>\n",errmsg);
    }
}

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]