Skip to content

Commit

Permalink
archive: ensure files are written in binary mode
Browse files Browse the repository at this point in the history
On POSIX-compliant operating systems (e.g. Linux, macOS), there is
no difference between binary mode and text mode, but Windows
transforms line feeds ("\n") to "\r\n" sequences during write
operations, resulting in corrupted images.
  • Loading branch information
kleisauke committed Oct 3, 2023
1 parent 5169dd9 commit 746a8f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libvips/foreign/archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ vips__archive_mkfile_file(VipsArchive *archive,

path = g_build_filename(archive->base_dirname, filename, NULL);

if (!(f = vips__file_open_write(path, TRUE))) {
if (!(f = vips__file_open_write(path, FALSE))) {
g_free(path);
return -1;
}
Expand Down

0 comments on commit 746a8f6

Please sign in to comment.