diff options
author | Andreas Obergrusberger <tradiaz@yahoo.de> | 2007-06-17 12:19:39 +0000 |
---|---|---|
committer | Andreas Obergrusberger <tradiaz@yahoo.de> | 2007-06-17 12:19:39 +0000 |
commit | 8ca4dfdb3e3deaa5246c1e339e773c90d2db7451 (patch) | |
tree | ca2596feb714dfe383dcd0825a9261e1570c5fa0 | |
parent | 426c6c4c7fd400cc3bec6d73de36b0ac58e12419 (diff) | |
download | mpd-8ca4dfdb3e3deaa5246c1e339e773c90d2db7451.tar.gz mpd-8ca4dfdb3e3deaa5246c1e339e773c90d2db7451.tar.xz mpd-8ca4dfdb3e3deaa5246c1e339e773c90d2db7451.zip |
2 critical bugs in leoslyrics lyrics src fixed
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@6630 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | plugins/leoslyrics/lyrics_leoslyrics.c | 7 | ||||
-rw-r--r-- | src/lyrics_leoslyrics.c | 9 |
4 files changed, 16 insertions, 3 deletions
@@ -1,3 +1,5 @@ +2007-06-17 Andreas Obergrusberger <tradiaz@yahoo.de> + * two critical bugs in leoslyrics source have been fixed 2007-02-16 Andreas Obergrusberger <tradiaz@yahoo.de> + nj has posted a lot of patches on the bug tracker * added the option to search for artist and title at the same time diff --git a/configure.ac b/configure.ac index d24c4a558..3ffc87009 100644 --- a/configure.ac +++ b/configure.ac @@ -449,3 +449,4 @@ AC_CONFIG_FILES([Makefile src/Makefile plugins/Makefile doc/Makefile po/Makefile plugins/hd/Makefile plugins/leoslyrics/Makefile]) AC_OUTPUT +AC_MSG_WARN([TO BUILD AN INSTALL THE PLUGINS cd TO THE plugins DIRECTORY AND EXECUTE make && make install THERE]) diff --git a/plugins/leoslyrics/lyrics_leoslyrics.c b/plugins/leoslyrics/lyrics_leoslyrics.c index a62e47f05..5bcb32242 100644 --- a/plugins/leoslyrics/lyrics_leoslyrics.c +++ b/plugins/leoslyrics/lyrics_leoslyrics.c @@ -50,7 +50,7 @@ static void check_search_response(void *data, const char *name, { if(strstr(atts[2], "hid") != NULL) { - hid = atts[3]; + hid = strdup (atts[3]); } if(strstr(atts[2], "exactMatch") != NULL) @@ -120,6 +120,11 @@ int check_lyr_leoslyrics(char *artist, char *title, char *url) XML_ParserFree(parser); if(!(result & 4)) return -1; //check whether lyrics found + + CURL *curl = curl_easy_init (); + char *esc_hid = curl_easy_escape (curl, hid, 0); + free (hid); + snprintf(url, 512, LEOSLYRICS_CONTENT_URL, hid); return 0; diff --git a/src/lyrics_leoslyrics.c b/src/lyrics_leoslyrics.c index 3b85e68d3..4afb3fa7b 100644 --- a/src/lyrics_leoslyrics.c +++ b/src/lyrics_leoslyrics.c @@ -50,7 +50,7 @@ static void check_search_response(void *data, const char *name, { if(strstr(atts[2], "hid") != NULL) { - hid = atts[3]; + hid = strdup (atts[3]); } if(strstr(atts[2], "exactMatch") != NULL) @@ -120,7 +120,12 @@ int check_lyr_leoslyrics(char *artist, char *title, char *url) XML_ParserFree(parser); if(!(result & 4)) return -1; //check whether lyrics found - snprintf(url, 512, LEOSLYRICS_CONTENT_URL, hid); + + CURL *curl = curl_easy_init (); + char *esc_hid = curl_easy_escape (curl, hid, 0); + free (hid); + + snprintf(url, 512, LEOSLYRICS_CONTENT_URL, esc_hid); return 0; } |