changeset 7461:c1ddc403fda4

[gaim-migrate @ 8074] windows is really getting on my nerves, luckily SimGuy is very patient /nick ZenGuy committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 08 Nov 2003 08:21:48 +0000
parents 3973a09525b3
children 5fb4cbf1ac54
files src/log.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/log.c	Sat Nov 08 05:52:39 2003 +0000
+++ b/src/log.c	Sat Nov 08 08:21:48 2003 +0000
@@ -615,7 +615,7 @@
 	GaimLog *log = NULL;
 	GList *list = NULL;
 
-	if (!(file = fopen(path, "r"))) {
+	if (!(file = fopen(path, "rb"))) {
 		g_free(path);
 		return NULL;
 	}
@@ -648,6 +648,9 @@
 						strlen("---- New Conversation @ ") + strlen("----");
 				}
 
+				if(strchr(buf, '\r'))
+					data->length--;
+
 				if (data->length != 0)
 					list = g_list_append(list, log);
 				else
@@ -682,7 +685,7 @@
 char * old_logger_read (GaimLog *log, GaimLogReadFlags *flags)
 {
 	struct old_logger_data *data = log->logger_data;
-	FILE *file = fopen(data->path, "r");
+	FILE *file = fopen(data->path, "rb");
 	char *read = g_malloc(data->length + 1);
 	fseek(file, data->offset, SEEK_SET);
 	fread(read, data->length, 1, file);
@@ -690,6 +693,7 @@
 	*flags = 0;
 	if(strstr(read, "<BR>"))
 		*flags |= GAIM_LOG_READ_NO_NEWLINE;
+	gaim_str_strip_linefeed(read);
 	return read;
 }