From 6924ae48b47711b9da4b5c7bd333a04e7110238e Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 6 Nov 2015 21:19:09 +0000 Subject: In ./configure, select a RE syntax for word boundaries supported by libc; issue reported by Svyatoslav Mishyn, Peter Bray, and Daniel Levai. --- test-rewb-sysv.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test-rewb-sysv.c (limited to 'test-rewb-sysv.c') diff --git a/test-rewb-sysv.c b/test-rewb-sysv.c new file mode 100644 index 00000000..cb35c544 --- /dev/null +++ b/test-rewb-sysv.c @@ -0,0 +1,26 @@ +#include +#include + +int +main(void) +{ + regex_t re; + + if (regcomp(&re, "\\", REG_EXTENDED | REG_NOSUB)) + return 1; + if (regexec(&re, "the word is here", 0, NULL, 0)) + return 2; + if (regexec(&re, "same word", 0, NULL, 0)) + return 3; + if (regexec(&re, "word again", 0, NULL, 0)) + return 4; + if (regexec(&re, "word", 0, NULL, 0)) + return 5; + if (regexec(&re, "wordy", 0, NULL, 0) != REG_NOMATCH) + return 6; + if (regexec(&re, "sword", 0, NULL, 0) != REG_NOMATCH) + return 7; + if (regexec(&re, "reworded", 0, NULL, 0) != REG_NOMATCH) + return 8; + return 0; +} -- cgit