use extended regex and fix example regex for realsies

This commit is contained in:
Hiltjo Posthuma 2017-07-22 12:32:08 +02:00 committed by Laslo Hunhold
parent 0fc6b0cccd
commit 2a5ab48294
2 changed files with 2 additions and 2 deletions

View file

@ -20,7 +20,7 @@ static struct {
regex_t re; regex_t re;
} vhost[] = { } vhost[] = {
/* canonical host host regex directory */ /* canonical host host regex directory */
{ "example.org", "^(www\\.)?example.org$", "/example.org" }, { "example.org", "^(www\\.)?example\\.org$", "/example.org" },
}; };
/* mime-types */ /* mime-types */

View file

@ -1010,7 +1010,7 @@ main(int argc, char *argv[])
if (vhosts) { if (vhosts) {
for (i = 0; i < LEN(vhost); i++) { for (i = 0; i < LEN(vhost); i++) {
if (regcomp(&vhost[i].re, vhost[i].regex, if (regcomp(&vhost[i].re, vhost[i].regex,
REG_ICASE | REG_NOSUB)) { REG_EXTENDED | REG_ICASE | REG_NOSUB)) {
die("%s: regcomp '%s': invalid regex\n", argv0, die("%s: regcomp '%s': invalid regex\n", argv0,
vhost[i].regex); vhost[i].regex);
} }