summary refs log tree commit diff stats
path: root/src/common/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/text.c')
-rw-r--r--src/common/text.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/common/text.c b/src/common/text.c
index 2a8a50f7..ae18b8e6 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -176,7 +176,11 @@ scrollback_shrink (session *sess)
 		p++;
 	}
 
+#ifdef WIN32
+	fh = g_open (file, O_CREAT | O_TRUNC | O_APPEND | O_WRONLY | _O_BINARY, 0644);
+#else
 	fh = g_open (file, O_CREAT | O_TRUNC | O_APPEND | O_WRONLY, 0644);
+#endif
 	g_free (file);
 	if (fh == -1)
 	{
@@ -301,13 +305,6 @@ scrollback_load (session *sess)
 		{
 			char *buf_tmp;
 
-			/* If nothing but funny trailing matter e.g. 0x0d or 0x0d0a, toss it */
-			if (n_bytes >= 1 && buf[0] == 0x0d)
-			{
-				g_free (buf);
-				continue;
-			}
-
 			n_bytes--;
 			buf_tmp = buf;
 			buf = g_strndup (buf_tmp, n_bytes);
@@ -599,7 +596,7 @@ log_open_file (char *servname, char *channame, char *netname)
 		return -1;
 
 #ifdef WIN32
-	fd = g_open (file, O_CREAT | O_APPEND | O_WRONLY, S_IREAD|S_IWRITE);
+	fd = g_open (file, O_CREAT | O_APPEND | O_WRONLY | _O_BINARY, S_IREAD|S_IWRITE);
 #else
 	fd = g_open (file, O_CREAT | O_APPEND | O_WRONLY, 0644);
 #endif