This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
regcomp problem with 2.1.3
- To: libc-alpha Mailinglist <libc-alpha at sourceware dot cygnus dot com>
- Subject: regcomp problem with 2.1.3
- From: Andreas Jaeger <aj at suse dot de>
- Date: 15 May 2000 15:34:26 +0200
- Cc: Andreas Hartmann <andihartmann at 01019freenet dot de>
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