Back to index

glibc  2.9
Functions | Variables
bug-regex25.c File Reference
#include <locale.h>
#include <regex.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Functions

int main (void)

Variables

const char * str1 = "\xa3\xd8\xa3\xc9\xa3\xc9"
const char * str2 = "\xa3\xd8\xa3\xc9"

Function Documentation

int main ( void  )

Definition at line 30 of file bug-regex25.c.

{
  setlocale (LC_ALL, "ja_JP.eucJP");

  re_set_syntax (RE_SYNTAX_SED);

  struct re_pattern_buffer re;
  memset (&re, 0, sizeof (re));

  struct re_registers regs;
  memset (&regs, 0, sizeof (regs));

  re_compile_pattern ("$", 1, &re);

  int ret = 0, r = re_search (&re, str1, 4, 0, 4, &regs);
  if (r != 4)
    {
      printf ("First re_search returned %d\n", r);
      ret = 1;
    }
  r = re_search (&re, str2, 4, 0, 4, &regs);
  if (r != 4)
    {
      printf ("Second re_search returned %d\n", r);
      ret = 1;
    }
  return ret;
}

Here is the call graph for this function:


Variable Documentation

const char* str1 = "\xa3\xd8\xa3\xc9\xa3\xc9"

Definition at line 26 of file bug-regex25.c.

const char* str2 = "\xa3\xd8\xa3\xc9"

Definition at line 27 of file bug-regex25.c.