sync with sylpheed 0.7.4cvs2
authorPaul Mangan <paul@claws-mail.org>
Thu, 14 Mar 2002 10:17:32 +0000 (10:17 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 14 Mar 2002 10:17:32 +0000 (10:17 +0000)
43 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/account.c
src/addrbook.c
src/addrindex.c
src/compose.c
src/imap.c
src/inc.c
src/jpilot.c
src/ldif.c
src/matcher.c
src/mbox.c
src/mbox_folder.c
src/messageview.c
src/mimeview.c
src/mutt.c
src/news.c
src/pgptext.c
src/pop.c
src/prefs.c
src/prefs_actions.c
src/prefs_common.c
src/prefs_customheader.c
src/prefs_display_header.c
src/prefs_filter.c
src/procheader.c
src/procmime.c
src/procmsg.c
src/quote_fmt_parse.y
src/recv.c
src/rfc2015.c
src/selective_download.c
src/send.c
src/sourcewindow.c
src/summaryview.c
src/template.c
src/textview.c
src/unmime.c
src/utils.c
src/vcard.c
src/xml.c

index 4b4a14cc0a25208a6d5fb1f407f682f61c315d85..91662d1c8c8d5e7d25fd99950441877f80ceadf8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,38 @@
+2002-03-13
+
+       * src/messageview.c: messageview_show(): display single-part
+         text/html messages with the normal text view.
+       * src/account.c
+         src/addrbook.c
+         src/addrindex.c
+         src/compose.c
+         src/imap.c
+         src/inc.c
+         src/jpilot.c
+         src/ldif.c
+         src/mbox.c
+         src/mimeview.c
+         src/news.c
+         src/prefs.c
+         src/prefs_common.c
+         src/prefs_customheader.c
+         src/prefs_display_header.c
+         src/prefs_filter.c
+         src/procheader.c
+         src/procmime.c
+         src/procmsg.c
+         src/recv.c
+         src/rfc2015.c
+         src/send.c
+         src/sourcewindow.c
+         src/summaryview.c
+         src/template.c
+         src/textview.c
+         src/unmime.c
+         src/utils.c
+         src/vcard.c
+         src/xml.c: added 'b' to the option of all fopen().
+
 2002-03-09
 
        * version 0.7.4
 2002-03-09
 
        * version 0.7.4
index 53fe91b10c80339aab34f522fb2498ae88233458..f93b5950fb9598980525e430eb066cf10732e4be 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-14 [paul]      0.7.4claws2
+
+       * sync with sylpheed 0.7.4cvs2
+               see ChangeLog entry 2002-03-13
+
 2002-03-12 [darko]     0.7.4claws1
 
        * src/mainwindow.c
 2002-03-12 [darko]     0.7.4claws1
 
        * src/mainwindow.c
index 7d81676722dc11549d936a57b6d8c6c2fbbad26a..e8b606a45465e87b8321a8280b42ef6feed94b88 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-13
+
+       * src/messageview.c: messageview_show(): ¥·¥ó¥°¥ë¥Ñ¡¼¥È¤Î text/html
+         ¥á¥Ã¥»¡¼¥¸¤òÄ̾ï¤Î¥Æ¥­¥¹¥È¥Ó¥å¡¼¤Çɽ¼¨¡£
+
 2002-03-09
 
        * version 0.7.4
 2002-03-09
 
        * version 0.7.4
index 8ce0e4f392acb72b5164c028863a4f73bef1fd37..d5dbb51206af07d4cfdb42c364f910d475577e5e 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws1
+EXTRA_VERSION=claws2
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 72eac024e74b90b0bd26bf53a942098fa713042a..7a953f8eaac66c951fae27c253bcbf1c6d73b094 100644 (file)
@@ -119,7 +119,7 @@ void account_read_config_all(void)
        debug_print(_("Reading all config for each account...\n"));
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACCOUNT_RC, NULL);
        debug_print(_("Reading all config for each account...\n"));
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACCOUNT_RC, NULL);
-       if ((fp = fopen(rcpath, "r")) == NULL) {
+       if ((fp = fopen(rcpath, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                return;
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                return;
index 70f8579432756c1fae7b6623ed09a0cfd9d24278..7db21ab963cf749c202fdc707c4a8ba026df89df 100644 (file)
@@ -1065,7 +1065,7 @@ gint addrbook_write_to( AddressBookFile *book, gchar *newFile ) {
 
        book->retVal = MGU_OPEN_FILE;
 #ifdef DEV_STANDALONE
 
        book->retVal = MGU_OPEN_FILE;
 #ifdef DEV_STANDALONE
-       fp = fopen( fileSpec, "w" );
+       fp = fopen( fileSpec, "wb" );
        g_free( fileSpec );
        if( fp ) {
                fputs( "<?xml version=\"1.0\" ?>\n", fp );
        g_free( fileSpec );
        if( fp ) {
                fputs( "<?xml version=\"1.0\" ?>\n", fp );
index e612aafa35a67e58c5b60523ac4edad84e98782f..d35c26252ca7ccffcd237656986fcf9aff524303 100644 (file)
@@ -1165,7 +1165,7 @@ gint addrindex_write_to( AddressIndex *addrIndex, const gchar *newFile ) {
        fileSpec = g_strconcat( addrIndex->filePath, G_DIR_SEPARATOR_S, newFile, NULL );
        addrIndex->retVal = MGU_OPEN_FILE;
 #ifdef DEV_STANDALONE
        fileSpec = g_strconcat( addrIndex->filePath, G_DIR_SEPARATOR_S, newFile, NULL );
        addrIndex->retVal = MGU_OPEN_FILE;
 #ifdef DEV_STANDALONE
-       fp = fopen( fileSpec, "w" );
+       fp = fopen( fileSpec, "wb" );
        g_free( fileSpec );
        if( fp ) {
                fputs( "<?xml version=\"1.0\" ?>\n", fp );
        g_free( fileSpec );
        if( fp ) {
                fputs( "<?xml version=\"1.0\" ?>\n", fp );
index 3e82cf9166705b1ffb81791bab7d3c9ef811c2ab..3c17d0450a8baadeba7317cec0a2c01972a56e30 100644 (file)
@@ -1765,7 +1765,7 @@ static void compose_exec_sig(Compose *compose, gchar *sigfile)
        if (strlen(sigfile) < 2)
          return;
  
        if (strlen(sigfile) < 2)
          return;
  
-       sigprg = popen(sigfile+1, "r");
+       sigprg = popen(sigfile+1, "rb");
        if (sigprg) {
 
                buf = g_malloc(buf_len);
        if (sigprg) {
 
                buf = g_malloc(buf_len);
@@ -1835,7 +1835,7 @@ static void compose_insert_file(Compose *compose, const gchar *file)
 
        g_return_if_fail(file != NULL);
 
 
        g_return_if_fail(file != NULL);
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return;
        }
                FILE_OP_ERROR(file, "fopen");
                return;
        }
@@ -1881,7 +1881,7 @@ static void compose_attach_append(Compose *compose, const gchar *file,
                alertpanel_notice(_("File %s is empty."), file);
                return;
        }
                alertpanel_notice(_("File %s is empty."), file);
                return;
        }
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                alertpanel_error(_("Can't read %s."), file);
                return;
        }
                alertpanel_error(_("Can't read %s."), file);
                return;
        }
@@ -2810,12 +2810,12 @@ static gint compose_bounce_write_to_file(Compose *compose, const gchar *file)
        size_t len;
        gchar buf[BUFFSIZE];
 
        size_t len;
        gchar buf[BUFFSIZE];
 
-       if ((fp = fopen(compose->bounce_filename, "r")) == NULL) {
+       if ((fp = fopen(compose->bounce_filename, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
 
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
 
-       if ((fdest = fopen(file, "w")) == NULL) {
+       if ((fdest = fopen(file, "wb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                fclose(fp);
                return -1;
                FILE_OP_ERROR(file, "fopen");
                fclose(fp);
                return -1;
@@ -2926,7 +2926,7 @@ static gint compose_write_to_file(Compose *compose, const gchar *file,
        const gchar *out_codeset;
        EncodingType encoding;
 
        const gchar *out_codeset;
        EncodingType encoding;
 
-       if ((fp = fopen(file, "w")) == NULL) {
+       if ((fp = fopen(file, "wb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
@@ -3066,7 +3066,7 @@ static gint compose_write_body_to_file(Compose *compose, const gchar *file)
        size_t len;
        gchar *chars;
 
        size_t len;
        gchar *chars;
 
-       if ((fp = fopen(file, "w")) == NULL) {
+       if ((fp = fopen(file, "wb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
@@ -3237,13 +3237,13 @@ static gint compose_queue(Compose *compose, gint *msgnum, FolderItem **item)
 
        /* add queue header */
        tmp = g_strdup_printf("%s%cqueue.%d", g_get_tmp_dir(),
 
        /* add queue header */
        tmp = g_strdup_printf("%s%cqueue.%d", g_get_tmp_dir(),
-                                     G_DIR_SEPARATOR, (gint)compose);
-       if ((fp = fopen(tmp, "w")) == NULL) {
+                             G_DIR_SEPARATOR, (gint)compose);
+       if ((fp = fopen(tmp, "wb")) == NULL) {
                FILE_OP_ERROR(tmp, "fopen");
                g_free(tmp);
                return -1;
        }
                FILE_OP_ERROR(tmp, "fopen");
                g_free(tmp);
                return -1;
        }
-       if ((src_fp = fopen(tmp2, "r")) == NULL) {
+       if ((src_fp = fopen(tmp2, "rb")) == NULL) {
                FILE_OP_ERROR(tmp2, "fopen");
                fclose(fp);
                unlink(tmp);
                FILE_OP_ERROR(tmp2, "fopen");
                fclose(fp);
                unlink(tmp);
@@ -3401,7 +3401,7 @@ static void compose_write_attach(Compose *compose, FILE *fp)
                gchar buf[BUFFSIZE];
                gchar inbuf[B64_LINE_SIZE], outbuf[B64_BUFFSIZE];
 
                gchar buf[BUFFSIZE];
                gchar inbuf[B64_LINE_SIZE], outbuf[B64_BUFFSIZE];
 
-               if ((attach_fp = fopen(ainfo->file, "r")) == NULL) {
+               if ((attach_fp = fopen(ainfo->file, "rb")) == NULL) {
                        g_warning(_("Can't open file %s\n"), ainfo->file);
                        continue;
                }
                        g_warning(_("Can't open file %s\n"), ainfo->file);
                        continue;
                }
index 1351a3a4243f07d0ee3d28fc5a150dff883b1e5a..0ab70b853b3328a25b6039464ce4ee688179d1ec 100644 (file)
@@ -2382,7 +2382,7 @@ static gint imap_cmd_append(SockInfo *sock, const gchar *destfolder,
        g_return_val_if_fail(file != NULL, IMAP_ERROR);
 
        size = get_file_size_as_crlf(file);
        g_return_val_if_fail(file != NULL, IMAP_ERROR);
 
        size = get_file_size_as_crlf(file);
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
index 11e9e49685e8e3c1a976b150d4f66da123f55417..37b535a3534d2bd7b982e7e74698ae8ce42a6a0c 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -774,7 +774,7 @@ static GHashTable *inc_get_uidl_table(PrefsAccount *ac_prefs)
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl-", ac_prefs->recv_server,
                           "-", ac_prefs->userid, NULL);
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl-", ac_prefs->recv_server,
                           "-", ac_prefs->userid, NULL);
-       if ((fp = fopen(path, "r")) == NULL) {
+       if ((fp = fopen(path, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
                g_free(path);
                return NULL;
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
                g_free(path);
                return NULL;
@@ -804,7 +804,7 @@ static void inc_write_uidl_list(Pop3State *state)
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl-", state->ac_prefs->recv_server,
                           "-", state->user, NULL);
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl-", state->ac_prefs->recv_server,
                           "-", state->user, NULL);
-       if ((fp = fopen(path, "w")) == NULL) {
+       if ((fp = fopen(path, "wb")) == NULL) {
                FILE_OP_ERROR(path, "fopen");
                g_free(path);
                return;
                FILE_OP_ERROR(path, "fopen");
                g_free(path);
                return;
index 046cdb1dcab2c204dd60925c46354c1edd8ebb65..a443bab2d567c59564bcd4888f836b0872001821 100644 (file)
@@ -640,7 +640,7 @@ static gint jpilot_get_file_info( JPilotFile *pilotFile, unsigned char **buf, in
        *buf_size=0;
 
        if( pilotFile->path ) {
        *buf_size=0;
 
        if( pilotFile->path ) {
-               in = fopen( pilotFile->path, "r" );
+               in = fopen( pilotFile->path, "rb" );
                if( !in ) {
                        return MGU_OPEN_FILE;
                }
                if( !in ) {
                        return MGU_OPEN_FILE;
                }
@@ -822,7 +822,7 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
                return MGU_BAD_ARGS;
        }
 
                return MGU_BAD_ARGS;
        }
 
-       in = fopen( pilotFile->path, "r" );
+       in = fopen( pilotFile->path, "rb" );
        if (!in) {
                return MGU_OPEN_FILE;
        }
        if (!in) {
                return MGU_OPEN_FILE;
        }
@@ -941,7 +941,7 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
        /* Read the PC3 file, if present */
        pcFile = jpilot_get_pc3_file( pilotFile );
        if( pcFile == NULL ) return MGU_SUCCESS;
        /* Read the PC3 file, if present */
        pcFile = jpilot_get_pc3_file( pilotFile );
        if( pcFile == NULL ) return MGU_SUCCESS;
-       pc_in = fopen( pcFile, "r");
+       pc_in = fopen( pcFile, "rb");
        g_free( pcFile );
 
        if( pc_in == NULL ) {
        g_free( pcFile );
 
        if( pc_in == NULL ) {
@@ -1562,7 +1562,7 @@ gchar *jpilot_find_pilotdb( void ) {
        strcat( str, JPILOT_DBHOME_FILE );
 
        /* Attempt to open */
        strcat( str, JPILOT_DBHOME_FILE );
 
        /* Attempt to open */
-       if( ( fp = fopen( str, "r" ) ) != NULL ) {
+       if( ( fp = fopen( str, "rb" ) ) != NULL ) {
                fclose( fp );
        }
        else {
                fclose( fp );
        }
        else {
index f8b48627830d2679a3de1d44e61470b1f33752d1..8c51aa63393b772aa3ea8d28a654cb99ced6542b 100644 (file)
@@ -192,7 +192,7 @@ void ldif_print_file( LdifFile *ldifFile, FILE *stream ) {
 static gint ldif_open_file( LdifFile* ldifFile ) {
        /* printf( "Opening file\n" ); */
        if( ldifFile->path ) {
 static gint ldif_open_file( LdifFile* ldifFile ) {
        /* printf( "Opening file\n" ); */
        if( ldifFile->path ) {
-               ldifFile->file = fopen( ldifFile->path, "r" );
+               ldifFile->file = fopen( ldifFile->path, "rb" );
                if( ! ldifFile->file ) {
                        /* printf( "can't open %s\n", ldifFile->path ); */
                        ldifFile->retVal = MGU_OPEN_FILE;
                if( ! ldifFile->file ) {
                        /* printf( "can't open %s\n", ldifFile->path ); */
                        ldifFile->retVal = MGU_OPEN_FILE;
index 8ec4e4ce7d27616eff398f0df96a8b9ef0ac3ffc..5f1530bc07458d976facbeeac45f9283fc0c5236 100644 (file)
@@ -626,7 +626,7 @@ gboolean matcherlist_match_file(MatcherList * matchers, MsgInfo * info,
        if (file == NULL)
                return FALSE;
 
        if (file == NULL)
                return FALSE;
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                g_free(file);
                return result;
                FILE_OP_ERROR(file, "fopen");
                g_free(file);
                return result;
@@ -1151,7 +1151,7 @@ void prefs_matcher_read_config(void)
        prefs_filtering_clear();
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, MATCHER_RC, NULL);
        prefs_filtering_clear();
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, MATCHER_RC, NULL);
-       f = fopen(rcpath, "r");
+       f = fopen(rcpath, "rb");
        g_free(rcpath);
 
        if (f != NULL)
        g_free(rcpath);
 
        if (f != NULL)
@@ -1162,7 +1162,7 @@ void prefs_matcher_read_config(void)
                printf("reading filtering\n");
                rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                     FILTERING_RC, NULL);
                printf("reading filtering\n");
                rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                     FILTERING_RC, NULL);
-               f = fopen(rcpath, "r");
+               f = fopen(rcpath, "rb");
                g_free(rcpath);
                
                if (f != NULL) {
                g_free(rcpath);
                
                if (f != NULL) {
@@ -1173,7 +1173,7 @@ void prefs_matcher_read_config(void)
                printf("reading scoring\n");
                rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                     SCORING_RC, NULL);
                printf("reading scoring\n");
                rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                     SCORING_RC, NULL);
-               f = fopen(rcpath, "r");
+               f = fopen(rcpath, "rb");
                g_free(rcpath);
                
                if (f != NULL) {
                g_free(rcpath);
                
                if (f != NULL) {
index e24a4aa8b926c2f534462117be76b09e95a6baff..56b5c0679b0462c63e6294f3709ccbe7b8496524 100644 (file)
@@ -69,7 +69,7 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, GHashTable *folder_table)
 
        debug_print(_("Getting messages from %s into %s...\n"), mbox, dest->path);
 
 
        debug_print(_("Getting messages from %s into %s...\n"), mbox, dest->path);
 
-       if ((mbox_fp = fopen(mbox, "r")) == NULL) {
+       if ((mbox_fp = fopen(mbox, "rb")) == NULL) {
                FILE_OP_ERROR(mbox, "fopen");
                return -1;
        }
                FILE_OP_ERROR(mbox, "fopen");
                return -1;
        }
@@ -108,7 +108,7 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, GHashTable *folder_table)
                gboolean is_next_msg = FALSE;
                gint msgnum;
 
                gboolean is_next_msg = FALSE;
                gint msgnum;
 
-               if ((tmp_fp = fopen(tmp_file, "w")) == NULL) {
+               if ((tmp_fp = fopen(tmp_file, "wb")) == NULL) {
                        FILE_OP_ERROR(tmp_file, "fopen");
                        g_warning(_("can't open temporary file\n"));
                        fclose(mbox_fp);
                        FILE_OP_ERROR(tmp_file, "fopen");
                        g_warning(_("can't open temporary file\n"));
                        fclose(mbox_fp);
@@ -261,7 +261,7 @@ gint lock_mbox(const gchar *base, LockType type)
                FILE *lockfp;
 
                lockfile = g_strdup_printf("%s.%d", base, getpid());
                FILE *lockfp;
 
                lockfile = g_strdup_printf("%s.%d", base, getpid());
-               if ((lockfp = fopen(lockfile, "w")) == NULL) {
+               if ((lockfp = fopen(lockfile, "wb")) == NULL) {
                        FILE_OP_ERROR(lockfile, "fopen");
                        g_warning(_("can't create lock file %s\n"), lockfile);
                        g_warning(_("use 'flock' instead of 'file' if possible.\n"));
                        FILE_OP_ERROR(lockfile, "fopen");
                        g_warning(_("can't create lock file %s\n"), lockfile);
                        g_warning(_("use 'flock' instead of 'file' if possible.\n"));
@@ -380,7 +380,7 @@ void empty_mbox(const gchar *mbox)
                FILE *fp;
 
                FILE_OP_ERROR(mbox, "truncate");
                FILE *fp;
 
                FILE_OP_ERROR(mbox, "truncate");
-               if ((fp = fopen(mbox, "w")) == NULL) {
+               if ((fp = fopen(mbox, "wb")) == NULL) {
                        FILE_OP_ERROR(mbox, "fopen");
                        g_warning(_("can't truncate mailbox to zero.\n"));
                        return;
                        FILE_OP_ERROR(mbox, "fopen");
                        g_warning(_("can't truncate mailbox to zero.\n"));
                        return;
@@ -406,7 +406,7 @@ gint export_to_mbox(FolderItem *src, const gchar *mbox)
        debug_print(_("Exporting messages from %s into %s...\n"),
                    src->path, mbox);
 
        debug_print(_("Exporting messages from %s into %s...\n"),
                    src->path, mbox);
 
-       if ((mbox_fp = fopen(mbox, "w")) == NULL) {
+       if ((mbox_fp = fopen(mbox, "wb")) == NULL) {
                FILE_OP_ERROR(mbox, "fopen");
                return -1;
        }
                FILE_OP_ERROR(mbox, "fopen");
                return -1;
        }
index b1848bcce0b0db9f1176cdd89fe6f3c115fa2e94..705fb3f3f6a848cb3cf512f3476e5154c9b97c41 100644 (file)
@@ -153,7 +153,7 @@ static gboolean mbox_file_lock_file(gchar * base)
        FILE *lockfp;
 
        lockfile = g_strdup_printf("%s.%d", base, getpid());
        FILE *lockfp;
 
        lockfile = g_strdup_printf("%s.%d", base, getpid());
-       if ((lockfp = fopen(lockfile, "w")) == NULL) {
+       if ((lockfp = fopen(lockfile, "wb")) == NULL) {
                FILE_OP_ERROR(lockfile, "fopen");
                g_warning(_("can't create lock file %s\n"), lockfile);
                g_warning(_("use 'flock' instead of 'file' if possible.\n"));
                FILE_OP_ERROR(lockfile, "fopen");
                g_warning(_("can't create lock file %s\n"), lockfile);
                g_warning(_("use 'flock' instead of 'file' if possible.\n"));
@@ -537,7 +537,7 @@ static mailfile * mailfile_init(char * filename)
        FILE * f;
        mailfile * mf;
   
        FILE * f;
        mailfile * mf;
   
-       f = fopen(filename, "r");
+       f = fopen(filename, "rb");
 
        if (f == NULL) {
                mailfile_error = MAILFILE_ERROR_FILE_NOT_FOUND;
 
        if (f == NULL) {
                mailfile_error = MAILFILE_ERROR_FILE_NOT_FOUND;
@@ -575,7 +575,7 @@ static char * readfile(char * filename, int offset, int max_offset)
        int bread;
        FILE * handle;
 
        int bread;
        FILE * handle;
 
-       handle = fopen(filename, "r");
+       handle = fopen(filename, "rb");
 
        if (handle == NULL) {
                mailfile_error = MAILFILE_ERROR_FILE_NOT_FOUND;
 
        if (handle == NULL) {
                mailfile_error = MAILFILE_ERROR_FILE_NOT_FOUND;
@@ -677,7 +677,7 @@ static int mailfile_find_deleted(mailfile f, char * filename)
 {
        FILE * handle;
 
 {
        FILE * handle;
 
-       handle = fopen(filename, "r");
+       handle = fopen(filename, "rb");
 
        while (elt) {
                struct _message m = elt->data;
 
        while (elt) {
                struct _message m = elt->data;
@@ -795,7 +795,7 @@ static void mbox_cache_get_msginfo(gchar * filename, GList * msg_list)
 {
        FILE * fp;
 
 {
        FILE * fp;
 
-       fp = fopen(filename, "r");
+       fp = fopen(filename, "rb");
        if (fp == NULL)
                return;
 
        if (fp == NULL)
                return;
 
@@ -1181,7 +1181,7 @@ GSList *mbox_get_msg_list(Folder *folder, FolderItem *item, gboolean use_cache)
 
        mbox_purge_deleted(mbox_path);
 
 
        mbox_purge_deleted(mbox_path);
 
-       fp = fopen(mbox_path, "r");
+       fp = fopen(mbox_path, "rb");
        
        if (fp == NULL) {
                g_free(mbox_path);
        
        if (fp == NULL) {
                g_free(mbox_path);
@@ -1255,7 +1255,7 @@ static gboolean mbox_extract_msg(FolderItem * item, gint msgnum,
        if (mbox_path == NULL)
                return FALSE;
 
        if (mbox_path == NULL)
                return FALSE;
 
-       src = fopen(mbox_path, "r");
+       src = fopen(mbox_path, "rb");
        if (src == NULL) {
                g_free(mbox_path);
                return FALSE;
        if (src == NULL) {
                g_free(mbox_path);
                return FALSE;
@@ -1290,7 +1290,7 @@ static gboolean mbox_extract_msg(FolderItem * item, gint msgnum,
 
        fseek(src, offset, SEEK_SET);
 
 
        fseek(src, offset, SEEK_SET);
 
-       dest = fopen(dest_filename, "w");
+       dest = fopen(dest_filename, "wb");
        if (dest == NULL) {
                mbox_unlock_file(src, mbox_path);
                fclose(src);
        if (dest == NULL) {
                mbox_unlock_file(src, mbox_path);
                fclose(src);
@@ -1384,7 +1384,7 @@ gint mbox_add_msg(Folder *folder, FolderItem *dest, const gchar *file,
                if (dest->last_num < 0) return -1;
        }
 
                if (dest->last_num < 0) return -1;
        }
 
-       src_fp = fopen(file, "r");
+       src_fp = fopen(file, "rb");
        if (src_fp == NULL) {
                return -1;
        }
        if (src_fp == NULL) {
                return -1;
        }
@@ -1393,7 +1393,7 @@ gint mbox_add_msg(Folder *folder, FolderItem *dest, const gchar *file,
        if (mbox_path == NULL)
                return -1;
 
        if (mbox_path == NULL)
                return -1;
 
-       dest_fp = fopen(mbox_path, "a");
+       dest_fp = fopen(mbox_path, "ab");
        if (dest_fp == NULL) {
                fclose(src_fp);
                g_free(mbox_path);
        if (dest_fp == NULL) {
                fclose(src_fp);
                g_free(mbox_path);
@@ -1520,7 +1520,7 @@ gint mbox_remove_all_msg(Folder *folder, FolderItem *item)
        if (mbox_path == NULL)
                return -1;
 
        if (mbox_path == NULL)
                return -1;
 
-       fp = fopen(mbox_path, "w");
+       fp = fopen(mbox_path, "wb");
        if (fp == NULL) {
                g_free(mbox_path);
                return -1;
        if (fp == NULL) {
                g_free(mbox_path);
                return -1;
@@ -1963,13 +1963,13 @@ static gboolean mbox_rewrite(gchar * mbox)
 
        debug_print(_("save modification - %s\n"), mbox);
 
 
        debug_print(_("save modification - %s\n"), mbox);
 
-       mbox_fp = fopen(mbox, "r+");
+       mbox_fp = fopen(mbox, "rb+");
        mbox_lockwrite_file(mbox_fp, mbox);
 
        mbox_cache_synchronize_from_file(mbox_fp, mbox, TRUE);
 
        new = g_strconcat(mbox, ".", itos((int) mbox), NULL);
        mbox_lockwrite_file(mbox_fp, mbox);
 
        mbox_cache_synchronize_from_file(mbox_fp, mbox, TRUE);
 
        new = g_strconcat(mbox, ".", itos((int) mbox), NULL);
-       new_fp = fopen(new, "w");
+       new_fp = fopen(new, "wb");
 
        if (change_file_mode_rw(new_fp, new) < 0) {
                FILE_OP_ERROR(new, "chmod");
 
        if (change_file_mode_rw(new_fp, new) < 0) {
                FILE_OP_ERROR(new, "chmod");
@@ -2057,13 +2057,13 @@ static gboolean mbox_purge_deleted(gchar * mbox)
 
        debug_print(_("purge deleted messages - %s\n"), mbox);
 
 
        debug_print(_("purge deleted messages - %s\n"), mbox);
 
-       mbox_fp = fopen(mbox, "r+");
+       mbox_fp = fopen(mbox, "rb+");
        mbox_lockwrite_file(mbox_fp, mbox);
 
        mbox_cache_synchronize_from_file(mbox_fp, mbox, TRUE);
 
        new = g_strconcat(mbox, ".", itos((int) mbox), NULL);
        mbox_lockwrite_file(mbox_fp, mbox);
 
        mbox_cache_synchronize_from_file(mbox_fp, mbox, TRUE);
 
        new = g_strconcat(mbox, ".", itos((int) mbox), NULL);
-       new_fp = fopen(new, "w");
+       new_fp = fopen(new, "wb");
 
        if (change_file_mode_rw(new_fp, new) < 0) {
                FILE_OP_ERROR(new, "chmod");
 
        if (change_file_mode_rw(new_fp, new) < 0) {
                FILE_OP_ERROR(new, "chmod");
index 9d2da805e347dc201cabeea97af9a1bc980438b4..df664c0ab03bd072830f58f1f17cba912439b715 100644 (file)
@@ -187,12 +187,12 @@ static gint disposition_notification_queue(PrefsAccount * account,
 
        tmp = g_strdup_printf("%s%cqueue.%d", g_get_tmp_dir(),
                              G_DIR_SEPARATOR, (gint)file);
 
        tmp = g_strdup_printf("%s%cqueue.%d", g_get_tmp_dir(),
                              G_DIR_SEPARATOR, (gint)file);
-       if ((fp = fopen(tmp, "w")) == NULL) {
+       if ((fp = fopen(tmp, "wb")) == NULL) {
                FILE_OP_ERROR(tmp, "fopen");
                g_free(tmp);
                return -1;
        }
                FILE_OP_ERROR(tmp, "fopen");
                g_free(tmp);
                return -1;
        }
-       if ((src_fp = fopen(file, "r")) == NULL) {
+       if ((src_fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                fclose(fp);
                unlink(tmp);
                FILE_OP_ERROR(file, "fopen");
                fclose(fp);
                unlink(tmp);
@@ -297,7 +297,7 @@ static gint disposition_notification_send(MsgInfo * msginfo)
        g_snprintf(tmp, sizeof(tmp), "%s%ctmpmsg%d",
                   get_rc_dir(), G_DIR_SEPARATOR, (gint)msginfo);
 
        g_snprintf(tmp, sizeof(tmp), "%s%ctmpmsg%d",
                   get_rc_dir(), G_DIR_SEPARATOR, (gint)msginfo);
 
-       if ((fp = fopen(tmp, "w")) == NULL) {
+       if ((fp = fopen(tmp, "wb")) == NULL) {
                FILE_OP_ERROR(tmp, "fopen");
                return -1;
        }
                FILE_OP_ERROR(tmp, "fopen");
                return -1;
        }
@@ -418,7 +418,8 @@ void messageview_show(MessageView *messageview, MsgInfo *msginfo,
        textview_set_all_headers(messageview->textview, all_headers);
        textview_set_all_headers(messageview->mimeview->textview, all_headers);
 
        textview_set_all_headers(messageview->textview, all_headers);
        textview_set_all_headers(messageview->mimeview->textview, all_headers);
 
-       if (mimeinfo->mime_type != MIME_TEXT) {
+       if (mimeinfo->mime_type != MIME_TEXT &&
+           mimeinfo->mime_type != MIME_TEXT_HTML) {
                messageview_change_view_type(messageview, MVIEW_MIME);
                mimeview_show_message(messageview->mimeview, mimeinfo, file);
        } else {
                messageview_change_view_type(messageview, MVIEW_MIME);
                mimeview_show_message(messageview->mimeview, mimeinfo, file);
        } else {
index 34b311dcb78e8d46c265f614d0b43fca531e0941..ff78a740fa1836f63c4e495eab3863cfc79122af 100644 (file)
@@ -288,7 +288,7 @@ void mimeview_show_message(MimeView *mimeview, MimeInfo *mimeinfo,
 
        mimeview->mimeinfo = mimeinfo;
 
 
        mimeview->mimeinfo = mimeinfo;
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return;
        }
                FILE_OP_ERROR(file, "fopen");
                return;
        }
@@ -425,7 +425,7 @@ static void mimeview_show_message_part(MimeView *mimeview, MimeInfo *partinfo)
 #endif /* USE_GPGME */
        if (!fname) return;
 
 #endif /* USE_GPGME */
        if (!fname) return;
 
-       if ((fp = fopen(fname, "r")) == NULL) {
+       if ((fp = fopen(fname, "rb")) == NULL) {
                FILE_OP_ERROR(fname, "fopen");
                return;
        }
                FILE_OP_ERROR(fname, "fopen");
                return;
        }
@@ -979,7 +979,7 @@ static void mimeview_check_signature(MimeView *mimeview)
        while (mimeinfo->parent)
                mimeinfo = mimeinfo->parent;
 
        while (mimeinfo->parent)
                mimeinfo = mimeinfo->parent;
 
-       if ((fp = fopen(mimeview->file, "r")) == NULL) {
+       if ((fp = fopen(mimeview->file, "rb")) == NULL) {
                FILE_OP_ERROR(mimeview->file, "fopen");
                return;
        }
                FILE_OP_ERROR(mimeview->file, "fopen");
                return;
        }
index d547c0759b259a489f064b0438221eb1fdd03e57..44205c9a37b18e7cd548d57a10e4830a1ac7549f 100644 (file)
@@ -105,7 +105,7 @@ void mutt_print_file( MuttFile *muttFile, FILE *stream ) {
 static gint mutt_open_file( MuttFile* muttFile ) {
        /* printf( "Opening file\n" ); */
        if( muttFile->path ) {
 static gint mutt_open_file( MuttFile* muttFile ) {
        /* printf( "Opening file\n" ); */
        if( muttFile->path ) {
-               muttFile->file = fopen( muttFile->path, "r" );
+               muttFile->file = fopen( muttFile->path, "rb" );
                if( ! muttFile->file ) {
                        /* printf( "can't open %s\n", muttFile->path ); */
                        muttFile->retVal = MGU_OPEN_FILE;
                if( ! muttFile->file ) {
                        /* printf( "can't open %s\n", muttFile->path ); */
                        muttFile->retVal = MGU_OPEN_FILE;
@@ -515,7 +515,7 @@ gchar *mutt_find_file( void ) {
        strcat( str, MUTT_HOME_FILE );
 
        /* Attempt to open */
        strcat( str, MUTT_HOME_FILE );
 
        /* Attempt to open */
-       if( ( fp = fopen( str, "r" ) ) != NULL ) {
+       if( ( fp = fopen( str, "rb" ) ) != NULL ) {
                fclose( fp );
        }
        else {
                fclose( fp );
        }
        else {
index b655e7f831cd9eb09b19722ae21d22fd3fa8c51c..4ee9cfb5ad789727b11559b0161fe9374acb36e4 100644 (file)
@@ -410,7 +410,7 @@ GSList *news_get_group_list(Folder *folder)
        filename = g_strconcat(path, G_DIR_SEPARATOR_S, NEWSGROUP_LIST, NULL);
        g_free(path);
 
        filename = g_strconcat(path, G_DIR_SEPARATOR_S, NEWSGROUP_LIST, NULL);
        g_free(path);
 
-       if ((fp = fopen(filename, "r")) == NULL) {
+       if ((fp = fopen(filename, "rb")) == NULL) {
                NNTPSession *session;
 
                session = news_session_get(folder);
                NNTPSession *session;
 
                session = news_session_get(folder);
@@ -433,7 +433,7 @@ GSList *news_get_group_list(Folder *folder)
                        return NULL;
                }
 
                        return NULL;
                }
 
-               if ((fp = fopen(filename, "r")) == NULL) {
+               if ((fp = fopen(filename, "rb")) == NULL) {
                        FILE_OP_ERROR(filename, "fopen");
                        g_free(filename);
                        return NULL;
                        FILE_OP_ERROR(filename, "fopen");
                        g_free(filename);
                        return NULL;
@@ -519,7 +519,7 @@ gint news_post(Folder *folder, const gchar *file)
        session = news_session_get(folder);
        if (!session) return -1;
 
        session = news_session_get(folder);
        if (!session) return -1;
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
@@ -916,7 +916,7 @@ gint news_cancel_article(Folder * folder, MsgInfo * msginfo)
        if (tmp == NULL)
                return -1;
 
        if (tmp == NULL)
                return -1;
 
-       if ((tmpfp = fopen(tmp, "w")) == NULL) {
+       if ((tmpfp = fopen(tmp, "wb")) == NULL) {
                FILE_OP_ERROR(tmp, "fopen");
                return -1;
        }
                FILE_OP_ERROR(tmp, "fopen");
                return -1;
        }
index 53a1f08c6017dad066568d8b277d9354636c1306..4ed72ec3f07c7686581deebb94d5abb0b0d66830 100644 (file)
@@ -231,7 +231,7 @@ int pgptext_is_encrypted (MimeInfo *mimeinfo, MsgInfo *msginfo)
        g_return_if_fail(file != NULL);
 
        if (mimeinfo->mime_type != MIME_TEXT) {
        g_return_if_fail(file != NULL);
 
        if (mimeinfo->mime_type != MIME_TEXT) {
-               if ((fp = fopen(file, "r")) == NULL) {
+               if ((fp = fopen(file, "rb")) == NULL) {
                        FILE_OP_ERROR(file, "fopen");
                        return;
                }
                        FILE_OP_ERROR(file, "fopen");
                        return;
                }
@@ -256,7 +256,7 @@ int pgptext_is_encrypted (MimeInfo *mimeinfo, MsgInfo *msginfo)
                }
                fclose(fp);
        } else {
                }
                fclose(fp);
        } else {
-               if ((fp = fopen(file, "r")) == NULL) {
+               if ((fp = fopen(file, "rb")) == NULL) {
                        FILE_OP_ERROR(file, "fopen");
                        return;
                }
                        FILE_OP_ERROR(file, "fopen");
                        return;
                }
@@ -329,7 +329,7 @@ void pgptext_decrypt_message (MsgInfo *msginfo, MimeInfo *mimeinfo, FILE *fp)
     fname = g_strdup_printf("%s%cplaintext.%08x",
                            get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
 
     fname = g_strdup_printf("%s%cplaintext.%08x",
                            get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
 
-    if ((dstfp = fopen(fname, "w")) == NULL) {
+    if ((dstfp = fopen(fname, "wb")) == NULL) {
         FILE_OP_ERROR(fname, "fopen");
         g_free(fname);
         msginfo->decryption_failed = 1;
         FILE_OP_ERROR(fname, "fopen");
         g_free(fname);
         msginfo->decryption_failed = 1;
index fbc976f529b6174bb2ea474117bf4d0ce22f4bfa..052c8a38f7b0a88c4d35ac6fb918dc1b7fe022c3 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -399,7 +399,7 @@ gint pop3_top_recv(SockInfo *sock, gpointer data)
        }
        /* we add a Complete-Size Header Item ...
           note: overwrites first line  --> this is dirty */
        }
        /* we add a Complete-Size Header Item ...
           note: overwrites first line  --> this is dirty */
-       if ( (fp = fopen(filename, "r+")) != NULL ) {
+       if ( (fp = fopen(filename, "rb+")) != NULL ) {
                gchar *buf = g_strdup_printf("%s%i", SIZE_HEADER, 
                                             state->msg[state->cur_msg].size);
        
                gchar *buf = g_strdup_printf("%s%i", SIZE_HEADER, 
                                             state->msg[state->cur_msg].size);
        
index 72b8aef181ab01ac922e440f4fc01f3e0767a992..33bf20583a9547c667b81bebcaa1019fccc2cec3 100644 (file)
@@ -56,7 +56,7 @@ void prefs_read_config(PrefParam *param, const gchar *label,
        prefs_set_default(param);
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, rcfile, NULL);
        prefs_set_default(param);
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, rcfile, NULL);
-       if ((fp = fopen(rcpath, "r")) == NULL) {
+       if ((fp = fopen(rcpath, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                return;
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                return;
@@ -159,7 +159,7 @@ void prefs_save_config(PrefParam *param, const gchar *label,
        g_return_if_fail(rcfile != NULL);
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, rcfile, NULL);
        g_return_if_fail(rcfile != NULL);
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, rcfile, NULL);
-       if ((orig_fp = fopen(rcpath, "r")) == NULL) {
+       if ((orig_fp = fopen(rcpath, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
        }
 
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
        }
 
@@ -272,7 +272,7 @@ PrefFile *prefs_write_open(const gchar *path)
        }
 
        tmppath = g_strconcat(path, ".tmp", NULL);
        }
 
        tmppath = g_strconcat(path, ".tmp", NULL);
-       if ((fp = fopen(tmppath, "w")) == NULL) {
+       if ((fp = fopen(tmppath, "wb")) == NULL) {
                FILE_OP_ERROR(tmppath, "fopen");
                g_free(tmppath);
                return NULL;
                FILE_OP_ERROR(tmppath, "fopen");
                g_free(tmppath);
                return NULL;
index 6c9ad6585a20e761068ca2404b468b9a07dbbc2c..4c39766ac701b8f03adc7ba25108386182ddc352 100644 (file)
@@ -441,7 +441,7 @@ void prefs_actions_read_config()
        debug_print(_("Reading actions configurations...\n"));
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACTIONS_RC, NULL);
        debug_print(_("Reading actions configurations...\n"));
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACTIONS_RC, NULL);
-       if ((fp = fopen(rcpath, "r")) == NULL) {
+       if ((fp = fopen(rcpath, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                return;
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                return;
index d0cd3c037c6f78950200377e172817bdbc2fcfd6..0dd45cc0f0178241eebce0c76a4109559a8b0acc 100644 (file)
@@ -841,7 +841,7 @@ void prefs_common_read_config(void)
 
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
                           NULL);
 
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
                           NULL);
-       if ((fp = fopen(path, "r")) == NULL) {
+       if ((fp = fopen(path, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
                g_free(path);
                return;
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
                g_free(path);
                return;
@@ -869,7 +869,7 @@ void prefs_common_save_config(void)
 
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
                           NULL);
 
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
                           NULL);
-       if ((fp = fopen(path, "w")) == NULL) {
+       if ((fp = fopen(path, "wb")) == NULL) {
                FILE_OP_ERROR(path, "fopen");
                g_free(path);
                return;
                FILE_OP_ERROR(path, "fopen");
                g_free(path);
                return;
index b5f5dcaae3cdcf5480f9549855eb984bd93b3954..74598af64c84e1c04effc3e0e63386a81eeca94f 100644 (file)
@@ -316,7 +316,7 @@ void prefs_custom_header_read_config(PrefsAccount *ac)
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                             CUSTOM_HEADER_RC, NULL);
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                             CUSTOM_HEADER_RC, NULL);
-       if ((fp = fopen(rcpath, "r")) == NULL) {
+       if ((fp = fopen(rcpath, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                ac->customhdr_list = NULL;
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                ac->customhdr_list = NULL;
@@ -362,7 +362,7 @@ void prefs_custom_header_write_config(PrefsAccount *ac)
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                             CUSTOM_HEADER_RC, NULL);
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                             CUSTOM_HEADER_RC, NULL);
 
-       if ((fp = fopen(rcpath, "r")) == NULL) {
+       if ((fp = fopen(rcpath, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
        } else {
                all_hdrs = NULL;
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
        } else {
                all_hdrs = NULL;
index be5fe0301210ad2bcd6efb22ebe599fc80226b13..91e209f53f8e8785de893d32fce6b918dc066348 100644 (file)
@@ -371,7 +371,7 @@ void prefs_display_header_read_config(void)
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                             DISPLAY_HEADER_RC, NULL);
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                             DISPLAY_HEADER_RC, NULL);
-       if ((fp = fopen(rcpath, "r")) == NULL) {
+       if ((fp = fopen(rcpath, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                prefs_common.disphdr_list = NULL;
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                prefs_common.disphdr_list = NULL;
index 7d36ca2a71cc69e8b29ee7d3a2a87a4c4bfbd1ed..40c94af199af2686e91cc5135601d354feb686b6 100644 (file)
@@ -497,7 +497,7 @@ void prefs_filter_read_config(void)
        debug_print(_("Reading filter configuration...\n"));
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, FILTER_RC, NULL);
        debug_print(_("Reading filter configuration...\n"));
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, FILTER_RC, NULL);
-       if ((fp = fopen(rcpath, "r")) == NULL) {
+       if ((fp = fopen(rcpath, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                return;
                if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
                g_free(rcpath);
                return;
index c5eeeeb6a4c4ddbea78dab95ba36df73a0176155..4e95ccff5ff368a95632a114a9a17c44584d0331 100644 (file)
@@ -191,7 +191,7 @@ GSList *procheader_get_header_list_from_file(const gchar *file)
        FILE *fp;
        GSList *hlist;
 
        FILE *fp;
        GSList *hlist;
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return NULL;
        }
                FILE_OP_ERROR(file, "fopen");
                return NULL;
        }
@@ -443,7 +443,7 @@ MsgInfo *procheader_parse(const gchar *file, MsgFlags flags,
        FILE *fp;
        MsgInfo *msginfo;
 
        FILE *fp;
        MsgInfo *msginfo;
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return NULL;
        }
                FILE_OP_ERROR(file, "fopen");
                return NULL;
        }
@@ -798,7 +798,7 @@ gint get_header_from_msginfo(MsgInfo *msginfo, gchar *buf, gint len,gchar *heade
        gint val;
        g_return_if_fail(msginfo != NULL);
        file = procmsg_get_message_file_path(msginfo);
        gint val;
        g_return_if_fail(msginfo != NULL);
        file = procmsg_get_message_file_path(msginfo);
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                g_free(file);
                return;
                FILE_OP_ERROR(file, "fopen");
                g_free(file);
                return;
index 1724692da7a314b459e6e62c84e122404e865bf9..9241d87b8b471c6b8fe1be5e485b659edede5191 100644 (file)
@@ -667,7 +667,7 @@ gint procmime_get_part(const gchar *outfile, const gchar *infile,
        g_return_val_if_fail(infile != NULL, -1);
        g_return_val_if_fail(mimeinfo != NULL, -1);
 
        g_return_val_if_fail(infile != NULL, -1);
        g_return_val_if_fail(mimeinfo != NULL, -1);
 
-       if ((infp = fopen(infile, "r")) == NULL) {
+       if ((infp = fopen(infile, "rb")) == NULL) {
                FILE_OP_ERROR(infile, "fopen");
                return -1;
        }
                FILE_OP_ERROR(infile, "fopen");
                return -1;
        }
@@ -676,7 +676,7 @@ gint procmime_get_part(const gchar *outfile, const gchar *infile,
                fclose(infp);
                return -1;
        }
                fclose(infp);
                return -1;
        }
-       if ((outfp = fopen(outfile, "w")) == NULL) {
+       if ((outfp = fopen(outfile, "wb")) == NULL) {
                FILE_OP_ERROR(outfile, "fopen");
                fclose(infp);
                return -1;
                FILE_OP_ERROR(outfile, "fopen");
                fclose(infp);
                return -1;
@@ -736,7 +736,7 @@ void renderer_read_config(void)
        renderer_list = NULL;
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, RENDERER_RC, NULL);
        renderer_list = NULL;
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, RENDERER_RC, NULL);
-       f = fopen(rcpath, "r");
+       f = fopen(rcpath, "rb");
        g_free(rcpath);
        
        if (f == NULL)
        g_free(rcpath);
        
        if (f == NULL)
@@ -957,7 +957,7 @@ gboolean procmime_find_string_part(MimeInfo *mimeinfo, const gchar *filename,
                             mimeinfo->mime_type == MIME_TEXT_ENRICHED, FALSE);
        g_return_val_if_fail(str != NULL, FALSE);
 
                             mimeinfo->mime_type == MIME_TEXT_ENRICHED, FALSE);
        g_return_val_if_fail(str != NULL, FALSE);
 
-       if ((infp = fopen(filename, "r")) == NULL) {
+       if ((infp = fopen(filename, "rb")) == NULL) {
                FILE_OP_ERROR(filename, "fopen");
                return FALSE;
        }
                FILE_OP_ERROR(filename, "fopen");
                return FALSE;
        }
@@ -1180,8 +1180,8 @@ GList *procmime_get_mime_type_list(void)
        if (mime_type_list) 
                return mime_type_list;
 
        if (mime_type_list) 
                return mime_type_list;
 
-       if ((fp = fopen("/etc/mime.types", "r")) == NULL) {
-               if ((fp = fopen(SYSCONFDIR "/mime.types", "r")) == NULL) {
+       if ((fp = fopen("/etc/mime.types", "rb")) == NULL) {
+               if ((fp = fopen(SYSCONFDIR "/mime.types", "rb")) == NULL) {
                        FILE_OP_ERROR(SYSCONFDIR "/mime.types", "fopen");
                        return NULL;
                }
                        FILE_OP_ERROR(SYSCONFDIR "/mime.types", "fopen");
                        return NULL;
                }
index b9881cfdf053d2d6f7596b4bbdc5c58d2428874e..4f69ba61b28cae1f1688f9fc5db541a013a5b6c4 100644 (file)
@@ -204,7 +204,7 @@ GSList *procmsg_read_cache(FolderItem *item, gboolean scan_file)
                g_free(path);
        }
        cache_file = folder_item_get_cache_file(item);
                g_free(path);
        }
        cache_file = folder_item_get_cache_file(item);
-       if ((fp = fopen(cache_file, "r")) == NULL) {
+       if ((fp = fopen(cache_file, "rb")) == NULL) {
                debug_print(_("\tNo cache file\n"));
                g_free(cache_file);
                return NULL;
                debug_print(_("\tNo cache file\n"));
                g_free(cache_file);
                return NULL;
@@ -481,7 +481,7 @@ FILE *procmsg_open_mark_file(const gchar *folder, gboolean append)
 
        markfile = g_strconcat(folder, G_DIR_SEPARATOR_S, MARK_FILE, NULL);
 
 
        markfile = g_strconcat(folder, G_DIR_SEPARATOR_S, MARK_FILE, NULL);
 
-       if ((fp = fopen(markfile, "r")) == NULL)
+       if ((fp = fopen(markfile, "rb")) == NULL)
                debug_print(_("Mark file not found.\n"));
        else if (fread(&ver, sizeof(ver), 1, fp) != 1 || MARK_VERSION != ver) {
                debug_print(_("Mark version is different (%d != %d). "
                debug_print(_("Mark file not found.\n"));
        else if (fread(&ver, sizeof(ver), 1, fp) != 1 || MARK_VERSION != ver) {
                debug_print(_("Mark version is different (%d != %d). "
@@ -499,12 +499,12 @@ FILE *procmsg_open_mark_file(const gchar *folder, gboolean append)
        if (fp) {
                /* reopen with append mode */
                fclose(fp);
        if (fp) {
                /* reopen with append mode */
                fclose(fp);
-               if ((fp = fopen(markfile, "a")) == NULL)
+               if ((fp = fopen(markfile, "ab")) == NULL)
                        g_warning(_("Can't open mark file with append mode.\n"));
        } else {
                /* open with overwrite mode if mark file doesn't exist or
                   version is different */
                        g_warning(_("Can't open mark file with append mode.\n"));
        } else {
                /* open with overwrite mode if mark file doesn't exist or
                   version is different */
-               if ((fp = fopen(markfile, "w")) == NULL)
+               if ((fp = fopen(markfile, "wb")) == NULL)
                        g_warning(_("Can't open mark file with write mode.\n"));
                else {
                        ver = MARK_VERSION;
                        g_warning(_("Can't open mark file with write mode.\n"));
                else {
                        ver = MARK_VERSION;
@@ -732,7 +732,7 @@ FILE *procmsg_open_message(MsgInfo *msginfo)
                g_return_val_if_fail(file != NULL, NULL);
        }
 
                g_return_val_if_fail(file != NULL, NULL);
        }
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                g_free(file);
                return NULL;
                FILE_OP_ERROR(file, "fopen");
                g_free(file);
                return NULL;
@@ -871,7 +871,7 @@ void procmsg_print_message(MsgInfo *msginfo, const gchar *cmdline)
        prtmp = g_strdup_printf("%s%cprinttmp.%08x",
                                get_mime_tmp_dir(), G_DIR_SEPARATOR, id++);
 
        prtmp = g_strdup_printf("%s%cprinttmp.%08x",
                                get_mime_tmp_dir(), G_DIR_SEPARATOR, id++);
 
-       if ((prfp = fopen(prtmp, "w")) == NULL) {
+       if ((prfp = fopen(prtmp, "wb")) == NULL) {
                FILE_OP_ERROR(prtmp, "fopen");
                g_free(prtmp);
                fclose(tmpfp);
                FILE_OP_ERROR(prtmp, "fopen");
                g_free(prtmp);
                fclose(tmpfp);
@@ -1048,7 +1048,7 @@ gint procmsg_send_message_queue(const gchar *file)
 
        g_return_val_if_fail(file != NULL, -1);
 
 
        g_return_val_if_fail(file != NULL, -1);
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
@@ -1090,7 +1090,7 @@ gint procmsg_send_message_queue(const gchar *file)
                /* write to temporary file */
                tmp = g_strdup_printf("%s%ctmp%d", g_get_tmp_dir(),
                            G_DIR_SEPARATOR, (gint)file);
                /* write to temporary file */
                tmp = g_strdup_printf("%s%ctmp%d", g_get_tmp_dir(),
                            G_DIR_SEPARATOR, (gint)file);
-               if ((tmpfp = fopen(tmp, "w")) == NULL) {
+               if ((tmpfp = fopen(tmp, "wb")) == NULL) {
                        FILE_OP_ERROR(tmp, "fopen");
                        newsval = -1;
                }
                        FILE_OP_ERROR(tmp, "fopen");
                        newsval = -1;
                }
index 041e88833e9507ee8975b345103efe362e78084b..4f2094eb981c4889239a9e3dba17dd2193568450 100644 (file)
@@ -484,7 +484,7 @@ insert:
                        FILE *file;
                        char buffer[256];
                        
                        FILE *file;
                        char buffer[256];
                        
-                       if(file = fopen($3, "r")) {
+                       if(file = fopen($3, "rb")) {
                                while(fgets(buffer, sizeof(buffer), file)) {
                                        INSERT(buffer);
                                }
                                while(fgets(buffer, sizeof(buffer), file)) {
                                        INSERT(buffer);
                                }
@@ -498,7 +498,7 @@ insert:
                        FILE *file;
                        char buffer[256];
 
                        FILE *file;
                        char buffer[256];
 
-                       if(file = popen($3, "r")) {
+                       if(file = popen($3, "rb")) {
                                while(fgets(buffer, sizeof(buffer), file)) {
                                        INSERT(buffer);
                                }
                                while(fgets(buffer, sizeof(buffer), file)) {
                                        INSERT(buffer);
                                }
index 58fd147b8e0fdadb30c26140e44b85e3a0721cd1..902a62fc34b9154b46abf0baa0d51b8aad15d248 100644 (file)
@@ -43,7 +43,7 @@ gint recv_write_to_file(SockInfo *sock, const gchar *filename)
 
        g_return_val_if_fail(filename != NULL, -1);
 
 
        g_return_val_if_fail(filename != NULL, -1);
 
-       if ((fp = fopen(filename, "w")) == NULL) {
+       if ((fp = fopen(filename, "wb")) == NULL) {
                FILE_OP_ERROR(filename, "fopen");
                recv_write(sock, NULL);
                return -1;
                FILE_OP_ERROR(filename, "fopen");
                recv_write(sock, NULL);
                return -1;
@@ -73,7 +73,7 @@ gint recv_bytes_write_to_file(SockInfo *sock, glong size, const gchar *filename)
 
        g_return_val_if_fail(filename != NULL, -1);
 
 
        g_return_val_if_fail(filename != NULL, -1);
 
-       if ((fp = fopen(filename, "w")) == NULL) {
+       if ((fp = fopen(filename, "wb")) == NULL) {
                FILE_OP_ERROR(filename, "fopen");
                recv_write(sock, NULL);
                return -1;
                FILE_OP_ERROR(filename, "fopen");
                recv_write(sock, NULL);
                return -1;
index a285c7d638338f5250c1c6140dd9efe98bb0cbce..cc177c9177a9565c073cc70b2fb603b248dccd7e 100644 (file)
@@ -378,7 +378,7 @@ copy_gpgmedata_to_temp (GpgmeData data, guint *length)
     tmp = g_strdup_printf("%s%cgpgtmp.%08x",
                           get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id );
 
     tmp = g_strdup_printf("%s%cgpgtmp.%08x",
                           get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id );
 
-    if ((fp = fopen(tmp, "w")) == NULL) {
+    if ((fp = fopen(tmp, "wb")) == NULL) {
         FILE_OP_ERROR(tmp, "fopen");
         g_free(tmp);
         return NULL;
         FILE_OP_ERROR(tmp, "fopen");
         g_free(tmp);
         return NULL;
@@ -616,7 +616,7 @@ void rfc2015_decrypt_message (MsgInfo *msginfo, MimeInfo *mimeinfo, FILE *fp)
     fname = g_strdup_printf("%s%cplaintext.%08x",
                            get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
 
     fname = g_strdup_printf("%s%cplaintext.%08x",
                            get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
 
-    if ((dstfp = fopen(fname, "w")) == NULL) {
+    if ((dstfp = fopen(fname, "wb")) == NULL) {
         FILE_OP_ERROR(fname, "fopen");
         g_free(fname);
         DECRYPTION_ABORT();
         FILE_OP_ERROR(fname, "fopen");
         g_free(fname);
         DECRYPTION_ABORT();
index bba07ed23ebbde567c7991ae5c5da28e7dfba743..2515346bec3686154f9afebea98c151e564f8820 100644 (file)
@@ -184,7 +184,7 @@ MsgInfo *sd_get_msginfo_from_file(const gchar *filename)
        MsgFlags msgflags = { 0, 0 };
 
        msginfo  = (MsgInfo*) procheader_parse(filename, msgflags, TRUE, FALSE);
        MsgFlags msgflags = { 0, 0 };
 
        msginfo  = (MsgInfo*) procheader_parse(filename, msgflags, TRUE, FALSE);
-       if ( (fp = fopen(filename, "r")) != NULL ) {
+       if ( (fp = fopen(filename, "rb")) != NULL ) {
                static HeaderEntry hentry[] = { { SIZE_HEADER, NULL, FALSE},
                                                { NULL, NULL, FALSE} };
                
                static HeaderEntry hentry[] = { { SIZE_HEADER, NULL, FALSE},
                                                { NULL, NULL, FALSE} };
                
index a22afc434a0157b90696921298fee19f94905ad7..4ae48d083156789e4e9e45174ec4b0cef3a481e4 100644 (file)
@@ -86,7 +86,7 @@ gint send_message(const gchar *file, PrefsAccount *ac_prefs, GSList *to_list)
        g_return_val_if_fail(ac_prefs != NULL, -1);
        g_return_val_if_fail(to_list != NULL, -1);
 
        g_return_val_if_fail(ac_prefs != NULL, -1);
        g_return_val_if_fail(to_list != NULL, -1);
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
@@ -139,7 +139,7 @@ gint send_message_queue(const gchar *file)
 
        g_return_val_if_fail(file != NULL, -1);
 
 
        g_return_val_if_fail(file != NULL, -1);
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
index 95987fea93cdade368f46bc988d10b75c996a55d..80594ab09fdba473aa28b8db4dfd1f85a3bc7dd3 100644 (file)
@@ -132,7 +132,7 @@ void source_window_show_msg(SourceWindow *sourcewin, MsgInfo *msginfo)
        file = procmsg_get_message_file(msginfo);
        g_return_if_fail(file != NULL);
 
        file = procmsg_get_message_file(msginfo);
        g_return_if_fail(file != NULL);
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                g_free(file);
                return;
                FILE_OP_ERROR(file, "fopen");
                g_free(file);
                return;
index cfe540e68663a9e9c7d59aaf1d7b978eadb1cec7..adf2f5aec8f11d1dd842ccd7c8f74db1526bb3ef 100644 (file)
@@ -2093,7 +2093,7 @@ gint summary_write_cache(SummaryView *summaryview)
 
        cachefile = folder_item_get_cache_file(summaryview->folder_item);
        g_return_val_if_fail(cachefile != NULL, -1);
 
        cachefile = folder_item_get_cache_file(summaryview->folder_item);
        g_return_val_if_fail(cachefile != NULL, -1);
-       if ((fps.cache_fp = fopen(cachefile, "w")) == NULL) {
+       if ((fps.cache_fp = fopen(cachefile, "wb")) == NULL) {
                FILE_OP_ERROR(cachefile, "fopen");
                g_free(cachefile);
                return -1;
                FILE_OP_ERROR(cachefile, "fopen");
                g_free(cachefile);
                return -1;
@@ -2117,7 +2117,7 @@ gint summary_write_cache(SummaryView *summaryview)
        g_free(cachefile);
 
        markfile = folder_item_get_mark_file(summaryview->folder_item);
        g_free(cachefile);
 
        markfile = folder_item_get_mark_file(summaryview->folder_item);
-       if ((fps.mark_fp = fopen(markfile, "w")) == NULL) {
+       if ((fps.mark_fp = fopen(markfile, "wb")) == NULL) {
                FILE_OP_ERROR(markfile, "fopen");
                fclose(fps.cache_fp);
                g_free(markfile);
                FILE_OP_ERROR(markfile, "fopen");
                fclose(fps.cache_fp);
                g_free(markfile);
index 2e1d7735f4772ff6cd86903db61270c8c37ae5ee..4e458d70bdfcd64c572e708b939d4a8ec07c4b9f 100644 (file)
@@ -42,7 +42,7 @@ static Template *template_load(gchar *filename)
 
        debug_print(_("%s:%d loading template from %s\n"), __FILE__, __LINE__, filename);
 
 
        debug_print(_("%s:%d loading template from %s\n"), __FILE__, __LINE__, filename);
 
-       if ((fp = fopen(filename, "r")) == NULL) {
+       if ((fp = fopen(filename, "rb")) == NULL) {
                FILE_OP_ERROR(filename, "fopen");
                return NULL;
        }
                FILE_OP_ERROR(filename, "fopen");
                return NULL;
        }
@@ -184,7 +184,7 @@ void template_write_config(GSList *tmpl_list)
                filename = g_strconcat(path, G_DIR_SEPARATOR_S,
                                       itos(tmpl_num), NULL);
 
                filename = g_strconcat(path, G_DIR_SEPARATOR_S,
                                       itos(tmpl_num), NULL);
 
-               if ((fp = fopen(filename, "w")) == NULL) {
+               if ((fp = fopen(filename, "wb")) == NULL) {
                        FILE_OP_ERROR(filename, "fopen");
                        g_free(filename);
                        g_free(path);
                        FILE_OP_ERROR(filename, "fopen");
                        g_free(filename);
                        g_free(path);
index b5bec13ed078b9ea40d511e3d3a18efe0f551292..81d465ac9ee29f62eb7238e3263578e48634f4f8 100644 (file)
@@ -298,7 +298,7 @@ void textview_show_message(TextView *textview, MimeInfo *mimeinfo,
        const gchar *charset = NULL;
        GPtrArray *headers = NULL;
 
        const gchar *charset = NULL;
        GPtrArray *headers = NULL;
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return;
        }
                FILE_OP_ERROR(file, "fopen");
                return;
        }
index e9f0c36219388e6d14bf11736d3c63e09eb71f3c..05d05fca82f81a67fa97b40c0f01a26e48843b5e 100644 (file)
@@ -918,9 +918,9 @@ int main(int argc, char *argv[])
 
   pid = getpid();
   sprintf(fnam, "/tmp/i_unmime.%x", pid);
 
   pid = getpid();
   sprintf(fnam, "/tmp/i_unmime.%x", pid);
-  fd_orig = fopen(fnam, "w");
+  fd_orig = fopen(fnam, "wb");
   sprintf(fnam, "/tmp/o_unmime.%x", pid);
   sprintf(fnam, "/tmp/o_unmime.%x", pid);
-  fd_conv = fopen(fnam, "w");
+  fd_conv = fopen(fnam, "wb");
 #endif
 
   BufSize = BUFSIZE_INCREMENT;    /* Initial size of buffer */
 #endif
 
   BufSize = BUFSIZE_INCREMENT;    /* Initial size of buffer */
index 6f09a59228df650015012b67254442812db322ff..818c6b61cbc68ad36735a27f8a286c3784cf7afc 100644 (file)
@@ -1326,7 +1326,7 @@ off_t get_file_size_as_crlf(const gchar *file)
        off_t size = 0;
        gchar buf[BUFFSIZE];
 
        off_t size = 0;
        gchar buf[BUFFSIZE];
 
-       if ((fp = fopen(file, "r")) == NULL) {
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
@@ -1721,7 +1721,7 @@ gint copy_file(const gchar *src, const gchar *dest)
        gchar *dest_bak = NULL;
        gboolean err = FALSE;
 
        gchar *dest_bak = NULL;
        gboolean err = FALSE;
 
-       if ((src_fp = fopen(src, "r")) == NULL) {
+       if ((src_fp = fopen(src, "rb")) == NULL) {
                FILE_OP_ERROR(src, "fopen");
                return -1;
        }
                FILE_OP_ERROR(src, "fopen");
                return -1;
        }
@@ -1735,7 +1735,7 @@ gint copy_file(const gchar *src, const gchar *dest)
                }
        }
 
                }
        }
 
-       if ((dest_fp = fopen(dest, "w")) == NULL) {
+       if ((dest_fp = fopen(dest, "wb")) == NULL) {
                FILE_OP_ERROR(dest, "fopen");
                fclose(src_fp);
                if (dest_bak) {
                FILE_OP_ERROR(dest, "fopen");
                fclose(src_fp);
                if (dest_bak) {
@@ -2243,7 +2243,7 @@ static FILE *log_fp = NULL;
 void set_log_file(const gchar *filename)
 {
        if (log_fp) return;
 void set_log_file(const gchar *filename)
 {
        if (log_fp) return;
-       log_fp = fopen(filename, "w");
+       log_fp = fopen(filename, "wb");
        if (!log_fp)
                FILE_OP_ERROR(filename, "fopen");
 }
        if (!log_fp)
                FILE_OP_ERROR(filename, "fopen");
 }
index 6f9f7a59a784cc31524baf468e17e1836901e026..6f6b883fe2cc191a40cc8027a3ac35f961b78d5f 100644 (file)
@@ -185,7 +185,7 @@ static gint vcard_open_file( VCardFile* cardFile ) {
        /* fprintf( stdout, "Opening file\n" ); */
        cardFile->addressCache->dataRead = FALSE;
        if( cardFile->path ) {
        /* fprintf( stdout, "Opening file\n" ); */
        cardFile->addressCache->dataRead = FALSE;
        if( cardFile->path ) {
-               cardFile->file = fopen( cardFile->path, "r" );
+               cardFile->file = fopen( cardFile->path, "rb" );
                if( ! cardFile->file ) {
                        /* fprintf( stderr, "can't open %s\n", cardFile->path ); */
                        cardFile->retVal = MGU_OPEN_FILE;
                if( ! cardFile->file ) {
                        /* fprintf( stderr, "can't open %s\n", cardFile->path ); */
                        cardFile->retVal = MGU_OPEN_FILE;
@@ -663,7 +663,7 @@ gchar *vcard_find_gnomecard( void ) {
        strcat( str, GNOMECARD_FILE );
 
        fileSpec = NULL;
        strcat( str, GNOMECARD_FILE );
 
        fileSpec = NULL;
-       if( ( fp = fopen( str, "r" ) ) != NULL ) {
+       if( ( fp = fopen( str, "rb" ) ) != NULL ) {
                /* Read configuration file */
                lenlbl = strlen( GNOMECARD_SECTION );
                while( fgets( buf, sizeof( buf ), fp ) != NULL ) {
                /* Read configuration file */
                lenlbl = strlen( GNOMECARD_SECTION );
                while( fgets( buf, sizeof( buf ), fp ) != NULL ) {
index f3a240385a4c292a803cac0c1ca5b0908ce00fcd..ee8dcc3971c6d8f75163ddf485dc8c74e7ea7e03 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -73,7 +73,7 @@ XMLFile *xml_open_file(const gchar *path)
 
        newfile = g_new(XMLFile, 1);
 
 
        newfile = g_new(XMLFile, 1);
 
-       newfile->fp = fopen(path, "r");
+       newfile->fp = fopen(path, "rb");
        if (!newfile->fp) {
                g_free(newfile);
                return NULL;
        if (!newfile->fp) {
                g_free(newfile);
                return NULL;