* sysdeps/m68k/dl-machine.h (_dl_start_user): Pass correct
[glibc.git] / posix / tst-regexloc.c
blob49872a80dffb79079d664a771c25ca67c976bbae
1 #include <sys/types.h>
2 #include <regex.h>
3 #include <locale.h>
4 #include <stdio.h>
6 int
7 main (int argc, char *argv[])
9 regex_t re;
10 regmatch_t mat[1];
11 int res = 1;
13 if (setlocale (LC_ALL, "de_DE.ISO-8859-1") == NULL)
14 puts ("cannot set locale");
15 else if (regcomp (&re, "[a-f]*", 0) != REG_NOERROR)
16 puts ("cannot compile expression \"[a-f]*\"");
17 else if (regexec (&re, "abcdefCDEF", 1, mat, 0) == REG_NOMATCH)
18 puts ("no match");
19 else
21 printf ("match from %d to %d\n", mat[0].rm_so, mat[0].rm_eo);
22 res = mat[0].rm_so != 0 || mat[0].rm_eo != 6;
25 return res;