X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fsession.c;h=76364aa3c5e46c214fa4731d9a394723caeeb49a;hb=9bf6cd2cfa9d558b77fef6cc320964d7e7f5fc6e;hp=4d64e327292f0deb7d17a4c121309e999afcb994;hpb=80a824573ac8ed4e8c6f24dbcecd2a49c8b4ffaa;p=pazpar2-moved-to-github.git diff --git a/src/session.c b/src/session.c index 4d64e32..76364aa 100644 --- a/src/session.c +++ b/src/session.c @@ -1125,9 +1125,15 @@ static int check_record_filter(xmlNode *root, struct session_database *sdb) if (type) { size_t len; - const char *eq = strchr(s, '~'); - if (eq) - len = eq - s; + int substring; + const char *eq; + + if ((eq = strchr(s, '='))) + substring = 0; + else if ((eq = strchr(s, '~'))) + substring = 1; + if (eq) + len = eq - s; else len = strlen(s); if (len == strlen((const char *)type) && @@ -1136,7 +1142,9 @@ static int check_record_filter(xmlNode *root, struct session_database *sdb) xmlChar *value = xmlNodeGetContent(n); if (value && *value) { - if (!eq || strstr((const char *) value, eq+1)) + if (!eq || + (substring && strstr((const char *) value, eq+1)) || + (!substring && !strcmp((const char *) value, eq + 1))) match = 1; } xmlFree(value);