mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-22 01:45:46 +01:00
patch to add binary mode on opening files (for Windows+Cygwin compatibility).
This commit is contained in:
@@ -420,7 +420,7 @@ dumpRImage(char *path, RImage *image)
|
||||
FILE *f;
|
||||
int channels = (image->format == RRGBAFormat ? 4 : 3);
|
||||
|
||||
f = fopen(path, "w");
|
||||
f = fopen(path, "wb");
|
||||
if (!f) {
|
||||
wsyserror(path);
|
||||
return;
|
||||
@@ -1352,7 +1352,7 @@ loadRImage(WMScreen *scr, char *path)
|
||||
int w, h, d;
|
||||
Pixmap pixmap;
|
||||
|
||||
f = fopen(path, "r");
|
||||
f = fopen(path, "rb");
|
||||
if (!f)
|
||||
return None;
|
||||
|
||||
|
||||
@@ -701,9 +701,9 @@ storeCommandInScript(char *cmd, char *line)
|
||||
|
||||
path = wstrconcat(wusergnusteppath(), "/Library/WindowMaker/autostart");
|
||||
|
||||
f = fopen(path, "r");
|
||||
f = fopen(path, "rb");
|
||||
if (!f) {
|
||||
f = fopen(path, "w");
|
||||
f = fopen(path, "wb");
|
||||
if (!f) {
|
||||
wsyserror(_("could not create %s"), path);
|
||||
goto end;
|
||||
@@ -719,7 +719,7 @@ storeCommandInScript(char *cmd, char *line)
|
||||
|
||||
tmppath = wstrconcat(wusergnusteppath(),
|
||||
"/Library/WindowMaker/autostart.tmp");
|
||||
fo = fopen(tmppath, "w");
|
||||
fo = fopen(tmppath, "wb");
|
||||
if (!fo) {
|
||||
wsyserror(_("could not create temporary file %s"), tmppath);
|
||||
wfree(tmppath);
|
||||
|
||||
Reference in New Issue
Block a user