From 92e40f4f3b8e153b86093996d2a6d2a1160e105d Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 11 May 2019 06:22:36 +0000 Subject: Add tryemptyregex/skalibs_regcomp, prepare for 2.8.1.0 --- src/sysdeps/tryemptyregex.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/sysdeps/tryemptyregex.c (limited to 'src/sysdeps/tryemptyregex.c') diff --git a/src/sysdeps/tryemptyregex.c b/src/sysdeps/tryemptyregex.c new file mode 100644 index 0000000..a2243f7 --- /dev/null +++ b/src/sysdeps/tryemptyregex.c @@ -0,0 +1,16 @@ +/* ISC license. */ + +#include + +int main (void) +{ + regex_t re ; + int r = regcomp(&re, "", REG_EXTENDED | REG_NOSUB) ; + switch (r) + { + case 0 : break ; + case REG_ESPACE : return 111 ; + default : return 1 ; + } + return !!regexec(&re, "a", 0, 0, 0) ; +} -- cgit v1.2.3