summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6e4eecb)
raw | patch | inline | side by side (parent: 6e4eecb)
author | Andreas Obergrusberger <tradiaz@yahoo.de> | |
Fri, 18 Jan 2008 13:53:06 +0000 (13:53 +0000) | ||
committer | Andreas Obergrusberger <tradiaz@yahoo.de> | |
Fri, 18 Jan 2008 13:53:06 +0000 (13:53 +0000) |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@7141 09075e82-0dd4-0310-85a5-a0d7c8717e4f
ChangeLog | patch | blob | history | |
src/lyrics_leoslyrics.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index d7df1755becdd946d0466e5362789767201db6f1..6426ff053b952a24ab9ca2acb0ee74d6aa1b1886 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2008-01-18 Andreas Obergrusberger <tradiaz@yahoo.de>
+ * improve escaping of URLs
+
2008-01-07 Andreas Obergrusberger <tradiaz@yahoo.de>
* Jose updated the slovak translation
index 4afb3fa7b5e9823b269df16500cb0bb01f1a4164..99dac9dde62efafff3a90d9fb84893e6ef5268b4 100644 (file)
--- a/src/lyrics_leoslyrics.c
+++ b/src/lyrics_leoslyrics.c
int check_lyr_leoslyrics(char *artist, char *title, char *url)
{
char url_avail[256];
+ CURL *curl = curl_easy_init ();
+
//this replacess the whitespaces with '+'
- g_strdelimit(artist, " ", '+');
- g_strdelimit(title, " ", '+');
-
+ char *esc_title = curl_easy_escape (curl, title, 0);
+ char *esc_artist = curl_easy_escape (curl, artist, 0);
//we insert the artist and the title into the url
- snprintf(url_avail, 512, LEOSLYRICS_SEARCH_URL, artist, title);
+ snprintf(url_avail, 512, LEOSLYRICS_SEARCH_URL, esc_artist, esc_title);
//download that xml!
easy_download_struct lyr_avail = {NULL, 0,-1};
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);