Mercurial > pidgin
changeset 28928:61e2537722e0
merge of '6e11e232a469bd7bd1f5c8dadebcfa5809eb1cd1'
and 'e200d014d204272dbca9f1f87a8192b0c3e85ef3'
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Mon, 01 Feb 2010 21:28:33 +0000 |
parents | 4f3a9ddfa34e (current diff) dac2aa640c4f (diff) |
children | 362d787f0b87 |
files | |
diffstat | 1 files changed, 10 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkthemes.c Mon Feb 01 21:26:35 2010 +0000 +++ b/pidgin/gtkthemes.c Mon Feb 01 21:28:33 2010 +0000 @@ -263,14 +263,7 @@ if (buf[0] == '#' || buf[0] == '\0') continue; - else { - int len = strlen(buf); - while (len && (buf[len - 1] == '\r' || buf[len - 1] == '\n')) - buf[--len] = '\0'; - if (len == 0) - continue; - } - + i = buf; while (isspace(*i)) i++; @@ -287,17 +280,25 @@ list->smileys = g_slist_reverse(list->smileys); list = child; } else if (!g_ascii_strncasecmp(i, "Name=", strlen("Name="))) { + int len; g_free(theme->name); theme->name = g_strdup(i + strlen("Name=")); + len = strlen(theme->name); + theme->name[len-1] = 0; + if(len > 2 && theme->name[len-2] == '\r') + theme->name[len-2] = 0; } else if (!g_ascii_strncasecmp(i, "Description=", strlen("Description="))) { g_free(theme->desc); theme->desc = g_strdup(i + strlen("Description=")); + theme->desc[strlen(theme->desc)-1] = 0; } else if (!g_ascii_strncasecmp(i, "Icon=", strlen("Icon="))) { g_free(theme->icon); theme->icon = g_build_filename(dirname, i + strlen("Icon="), NULL); + theme->icon[strlen(theme->icon)-1] = 0; } else if (!g_ascii_strncasecmp(i, "Author=", strlen("Author="))) { g_free(theme->author); theme->author = g_strdup(i + strlen("Author=")); + theme->author[strlen(theme->author)-1] = 0; } else if (load && list) { gboolean hidden = FALSE; char *sfile = NULL; @@ -310,7 +311,7 @@ char l[64]; int li = 0; while (!isspace(*i) && li < sizeof(l) - 1) { - if (*i == '\\' && *(i+1) != '\0') + if (*i == '\\' && *(i+1) != '\0' && *(i+1) != '\n' && *(i+1) != '\r') i++; l[li++] = *(i++); }