bin2res should open binary files in binary mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

When winefile is compiled on Windows, the folder icons are corrupted.
This happens because bin2res opens the binary resource files in the text
mode and adds "\r" before some occurrences of "\n".

This patch makes bin2res open binary files (icons and bitmaps) in the
binary mode, both for reading and writing.  POSIX systems are not
affected.

wrc already uses "rb" and "wb" when dealing with binary files.

ChangeLog:
	* tools/bin2res.c:
	Read and write binary files in binary mode on Windows.

-- 
Regards,
Pavel Roskin
--- tools/bin2res.c
+++ tools/bin2res.c
@@ -164,7 +164,7 @@ int process_resources(const char* input_
 	    if (inserting) fputc(c, ftmp);
 	if (c == EOF) break;
 
-	if (!(fres = fopen(res_file_name, inserting ? "r" : "w"))) break;
+	if (!(fres = fopen(res_file_name, inserting ? "rb" : "wb"))) break;
 	if (inserting)
 	{
 	    if (!insert_hexdump(ftmp, fres)) break;

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux