blob: d299edd0762350c38048514e104538c818dea042 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
/*
* Copyright 2011-2019 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
*
* Copyright 2011-2016 Mike Frysinger - <vapier@gentoo.org>
*/
#include "main.h"
#include "xregex.h"
#include <stdlib.h>
int wregcomp(regex_t *preg, const char *regex, int cflags)
{
int ret = regcomp(preg, regex, cflags);
if (unlikely(ret)) {
char errbuf[256];
regerror(ret, preg, errbuf, sizeof(errbuf));
warn("invalid regexp: %s -- %s\n", regex, errbuf);
}
return ret;
}
void xregcomp(regex_t *preg, const char *regex, int cflags)
{
if (unlikely(wregcomp(preg, regex, cflags)))
exit(EXIT_FAILURE);
}
|