Blame src/regression/regex-escaped-high-byte.c
|
Szabolcs Nagy |
2bfb41 |
// commit 39dfd58417ef642307d90306e1c7e50aaec5a35c 2015-03-20
|
|
Szabolcs Nagy |
2bfb41 |
// backslash followed by high byte should be parsed as a normal sequence
|
|
Szabolcs Nagy |
4be93b |
#include <locale.h>
|
|
Szabolcs Nagy |
2bfb41 |
#include <regex.h>
|
|
Szabolcs Nagy |
2bfb41 |
#include "test.h"
|
|
Szabolcs Nagy |
2bfb41 |
|
|
Szabolcs Nagy |
2bfb41 |
int main(void)
|
|
Szabolcs Nagy |
2bfb41 |
{
|
|
Szabolcs Nagy |
2bfb41 |
char buf[200];
|
|
Szabolcs Nagy |
2bfb41 |
regex_t r;
|
|
Szabolcs Nagy |
2bfb41 |
int n;
|
|
Szabolcs Nagy |
2bfb41 |
|
|
Szabolcs Nagy |
4be93b |
setlocale(LC_CTYPE, "C.UTF-8");
|
|
Szabolcs Nagy |
4be93b |
|
|
Szabolcs Nagy |
1a68cd |
// illegal sequence (not U+00FC)
|
|
Szabolcs Nagy |
2bfb41 |
n = regcomp(&r, "\\\xfc", 0);
|
|
Szabolcs Nagy |
2bfb41 |
if (n != REG_BADPAT) {
|
|
Szabolcs Nagy |
2bfb41 |
regerror(n, &r, buf, sizeof buf);
|
|
Szabolcs Nagy |
2bfb41 |
t_error("regcomp(\\\\\\xfc) returned %d (%s) wanted REG_BADPAT\n", n, buf);
|
|
Szabolcs Nagy |
2bfb41 |
}
|
|
Szabolcs Nagy |
2bfb41 |
|
|
Szabolcs Nagy |
2bfb41 |
return t_status;
|
|
Szabolcs Nagy |
2bfb41 |
}
|