Mercurial > pidgin
changeset 10906:5e41c817dfa2
[gaim-migrate @ 12636]
Escape HTML entities when reading old plain text log files
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sun, 08 May 2005 15:21:18 +0000 |
parents | d41e285af79e |
children | 4f5fa4cc7eb4 |
files | src/log.c |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/log.c Sat May 07 17:44:00 2005 +0000 +++ b/src/log.c Sun May 08 15:21:18 2005 +0000 @@ -969,7 +969,7 @@ { struct old_logger_data *data = log->logger_data; FILE *file = g_fopen(gaim_stringref_value(data->pathref), "rb"); - char *read = g_malloc(data->length + 1); + char *tmp, *read = g_malloc(data->length + 1); fseek(file, data->offset, SEEK_SET); fread(read, data->length, 1, file); fclose(file); @@ -977,6 +977,11 @@ *flags = 0; if(strstr(read, "<BR>")) *flags |= GAIM_LOG_READ_NO_NEWLINE; + else { + tmp = g_markup_escape_text(read, -1); + g_free(read); + read = tmp; + } return read; }