- mimetype = strtok_r(line, " \t\r\n", &saveptr);
- while ((token = strtok_r(NULL, " \t\r\n", &saveptr))) {
- if (!strcasecmp(ext, token)) {
+ string_list_split_in_place(&list, line, " \t\r\n", -1);
+ string_list_remove_empty_items(&list, 0);
+ mimetype = list.items[0].string;
+ for (i = 1; i < list.nr; i++) {
+ if (!strcasecmp(ext, list.items[i].string)) {