core-util: Check that we actually have regexec before we use it

Thanks to Pierre Ossman for reporting the bug and providing an initial
fix on which this patch is based.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=69708
This commit is contained in:
Peter Meerwald 2013-11-29 15:58:42 +01:00 committed by Tanu Kaskinen
parent 826c8f69d3
commit 345de08f2b

View file

@ -954,6 +954,7 @@ void pa_reset_priority(void) {
} }
int pa_match(const char *expr, const char *v) { int pa_match(const char *expr, const char *v) {
#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H)
int k; int k;
regex_t re; regex_t re;
int r; int r;
@ -976,6 +977,10 @@ int pa_match(const char *expr, const char *v) {
errno = EINVAL; errno = EINVAL;
return r; return r;
#else
errno = ENOSYS;
return -1;
#endif
} }
/* Try to parse a boolean string value.*/ /* Try to parse a boolean string value.*/