changeset 25726:f50bf4ce7840

Set binary mode when opening files for IBB transfers. This prevents Windows from performing LF -> CRLF translation, resulting in corrupted files.
author Marcus Lundblad <ml@update.uu.se>
date Mon, 29 Sep 2008 17:28:54 +0000
parents daaabfcf5c2b
children e958c6335136
files libpurple/protocols/jabber/si.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/si.c	Sun Sep 28 09:43:45 2008 +0000
+++ b/libpurple/protocols/jabber/si.c	Mon Sep 29 17:28:54 2008 +0000
@@ -1015,7 +1015,7 @@
 			jabber_si_xfer_ibb_error_cb);
 		
 		/* open the file to write to */
-		jsx->fp = g_fopen(purple_xfer_get_local_filename(xfer), "w");
+		jsx->fp = g_fopen(purple_xfer_get_local_filename(xfer), "wb");
 		
 		jsx->ibb_session = sess;
 		
@@ -1083,7 +1083,7 @@
 	purple_xfer_start(xfer, 0, NULL, 0);
 	purple_xfer_set_bytes_sent(xfer, 0);
 	purple_xfer_update_progress(xfer);
-	jsx->fp = g_fopen(purple_xfer_get_local_filename(xfer), "r");
+	jsx->fp = g_fopen(purple_xfer_get_local_filename(xfer), "rb");
 	jabber_si_xfer_ibb_send_data(sess);
 }