--- tmp-mc/mc-4.5.99a/src/file.c	2002-07-05 06:04:41.000000000 +0200
+++ mc-4.5.99a/src/file.c	2002-07-23 20:18:10.000000000 +0200
@@ -578,7 +578,7 @@ copy_file_file (FileOpContext *ctx, char
 
     gettimeofday (&tv_transfer_start, (struct timezone *) NULL);
 
-    while ((src_desc = mc_open (src_path, O_RDONLY | O_LINEAR)) < 0){
+    while ((src_desc = mc_open (src_path, O_RDONLY | O_BINARY | O_LINEAR)) < 0){
 	return_status = file_error (_(" Cannot open source file \"%s\" \n %s "), src_path);
 	if (return_status == FILE_RETRY)
 	    continue;
@@ -615,7 +615,7 @@ copy_file_file (FileOpContext *ctx, char
        here, btw. Imagine copying to /tmp and symlink attack :-( */
 
     while ((dest_desc = mc_open (dst_path, O_WRONLY | 
-      (ctx->do_append ? O_APPEND : (O_CREAT | O_TRUNC)), 0600)) < 0){
+      (ctx->do_append ? O_APPEND : (O_CREAT | O_TRUNC)) | O_BINARY, 0600)) < 0){
         return_status = file_error (_(" Cannot create target file \"%s\" \n %s "), dst_path);
 	if (return_status == FILE_RETRY)
 	    continue;
