Back to index

glibc  2.9
Functions | Variables
bug-regex2.c File Reference
#include <sys/types.h>
#include <mcheck.h>
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.


int main (void)


static const char text [] = "This is a test; this is a test"

Function Documentation

int main ( void  )

Definition at line 31 of file bug-regex2.c.

  regex_t re;
  regmatch_t rm[2];
  int n;

  mtrace ();

  n = regcomp (&re, "a test", REG_EXTENDED);
  if (n != 0)
      char buf[500];
      regerror (n, &re, buf, sizeof (buf));
      printf ("regcomp failed: %s\n", buf);
      exit (1);

  for (n = 0; n < 20; ++n)
    regexec (&re, text, 2, rm, 0);

  regfree (&re);

  return 0;

Here is the call graph for this function:

Variable Documentation

const char text[] = "This is a test; this is a test" [static]

Definition at line 28 of file bug-regex2.c.