Make the old 'assign' case-insensitive again (+test) (Thanks aksr)

This commit is contained in:
Michael Stapelberg
2011-09-11 21:16:45 +01:00
parent 67cf37ce66
commit b3e1fb1f3b
2 changed files with 54 additions and 2 deletions

View File

@ -1071,11 +1071,23 @@ assign:
char *separator = NULL;
if ((separator = strchr(criteria, '/')) != NULL) {
*(separator++) = '\0';
match->title = regex_new(separator);
char *pattern;
if (asprintf(&pattern, "(?i)%s", separator) == -1) {
ELOG("asprintf failed\n");
break;
}
match->title = regex_new(pattern);
free(pattern);
printf(" title = %s\n", separator);
}
if (*criteria != '\0') {
match->class = regex_new(criteria);
char *pattern;
if (asprintf(&pattern, "(?i)%s", criteria) == -1) {
ELOG("asprintf failed\n");
break;
}
match->class = regex_new(pattern);
free(pattern);
printf(" class = %s\n", criteria);
}
free(criteria);