Please find below a patch to copy.c in fileutils-4.0 which ensures that the
source and destination files get opened in binary mode on platforms where it
makes a difference, such as Cygwin.

43a44,48
> /* O_BINARY isn't required (or even defined sometimes) under Unix */
> #ifndef O_BINARY
> #define O_BINARY 0
> #endif
>
179c184
<   source_desc = open (src_path, O_RDONLY);
---
>   source_desc = open (src_path, O_RDONLY | O_BINARY);
198c203
<   dest_desc = open (dst_path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
---
>   dest_desc = open (dst_path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY,
0600);

Reply via email to