Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforce.net>2011-04-29 03:01:28 +0400
committerJustin Maggard <jmaggard@users.sourceforce.net>2011-04-29 03:01:28 +0400
commit458a34cd1e8d4513bc6db0d8d944de6f09408b54 (patch)
treec7c5451fcb8007dad0f57f80d10eca30ab07d742 /upnpsoap.c
parentb7ef97b59397f50fc24168e651d5e7a459e94734 (diff)
* Fix a couple minor DLNA correctness issues.
Diffstat (limited to 'upnpsoap.c')
-rw-r--r--upnpsoap.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/upnpsoap.c b/upnpsoap.c
index 6cbff1c..7fb69d0 100644
--- a/upnpsoap.c
+++ b/upnpsoap.c
@@ -769,13 +769,13 @@ callback(void *args, int argc, char **argv, char **azColName)
passed_args->size += ret;
}
if( artist ) {
- if( (*mime == 'a') && (passed_args->filter & FILTER_UPNP_ARTIST) ) {
- ret = snprintf(str_buf, 512, "&lt;upnp:artist&gt;%s&lt;/upnp:artist&gt;", artist);
+ if( (*mime == 'v') && (passed_args->filter & FILTER_UPNP_ACTOR) ) {
+ ret = snprintf(str_buf, 512, "&lt;upnp:actor&gt;%s&lt;/upnp:actor&gt;", artist);
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
passed_args->size += ret;
}
- else if( (*mime == 'v') && (passed_args->filter & FILTER_UPNP_ACTOR) ) {
- ret = snprintf(str_buf, 512, "&lt;upnp:actor&gt;%s&lt;/upnp:actor&gt;", artist);
+ if( passed_args->filter & FILTER_UPNP_ARTIST ) {
+ ret = snprintf(str_buf, 512, "&lt;upnp:artist&gt;%s&lt;/upnp:artist&gt;", artist);
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
passed_args->size += ret;
}
@@ -1321,13 +1321,14 @@ SearchContentDirectory(struct upnphttp * h, const char * action)
groupBy[0] = '\0';
if( !SearchCriteria )
{
- asprintf(&newSearchCriteria, "1 = 1");
+ newSearchCriteria = strdup("1 = 1");
SearchCriteria = newSearchCriteria;
}
else
{
SearchCriteria = modifyString(SearchCriteria, "&quot;", "\"", 0);
SearchCriteria = modifyString(SearchCriteria, "&apos;", "'", 0);
+ SearchCriteria = modifyString(SearchCriteria, "\\\"", "\"\"", 0);
SearchCriteria = modifyString(SearchCriteria, "object.", "", 0);
SearchCriteria = modifyString(SearchCriteria, "derivedfrom", "like", 1);
SearchCriteria = modifyString(SearchCriteria, "contains", "like", 2);
@@ -1343,16 +1344,14 @@ SearchContentDirectory(struct upnphttp * h, const char * action)
SearchCriteria = modifyString(SearchCriteria, "@refID", "REF_ID", 0);
if( strstr(SearchCriteria, "@id") )
{
- newSearchCriteria = modifyString(strdup(SearchCriteria), "@id", "OBJECT_ID", 0);
- SearchCriteria = newSearchCriteria;
+ newSearchCriteria = strdup(SearchCriteria);
+ newSearchCriteria = SearchCriteria = modifyString(newSearchCriteria, "@id", "OBJECT_ID", 0);
}
if( strstr(SearchCriteria, "res is ") )
{
- if( newSearchCriteria )
- newSearchCriteria = modifyString(newSearchCriteria, "res is ", "MIME is ", 0);
- else
- newSearchCriteria = modifyString(strdup(SearchCriteria), "res is ", "MIME is ", 0);
- SearchCriteria = newSearchCriteria;
+ if( !newSearchCriteria )
+ newSearchCriteria = strdup(SearchCriteria);
+ newSearchCriteria = SearchCriteria = modifyString(newSearchCriteria, "res is ", "MIME is ", 0);
}
#if 0 // Does 360 need this?
if( strstr(SearchCriteria, "&amp;") )