Skip to content
This repository has been archived by the owner on Aug 16, 2020. It is now read-only.

Commit

Permalink
Fix FileIO() in Glk mode
Browse files Browse the repository at this point in the history
  • Loading branch information
curiousdannii committed Apr 3, 2017
1 parent 12375dc commit d2621ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.o
heglk/hugo.js*
10 changes: 5 additions & 5 deletions source/hemisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,10 +941,7 @@ void FileIO(void)

fref = glk_fileref_create_by_name(fileusage_Data | fileusage_BinaryMode,
fileiopath, 0);
if (glk_fileref_does_file_exist(fref))
io = glk_stream_open_file(fref, filemode_Read, 0);
else
io = NULL;
io = glk_stream_open_file(fref, filemode_Write, 0);
glk_fileref_destroy(fref);
if (io==NULL) goto LeaveFileIO;
#endif
Expand All @@ -961,7 +958,10 @@ void FileIO(void)

fref = glk_fileref_create_by_name(fileusage_Data | fileusage_BinaryMode,
fileiopath, 0);
io = glk_stream_open_file(fref, filemode_Read, 0);
if (glk_fileref_does_file_exist(fref))
io = glk_stream_open_file(fref, filemode_Read, 0);
else
io = NULL;
glk_fileref_destroy(fref);
if (io==NULL) goto LeaveFileIO;
#endif
Expand Down

0 comments on commit d2621ef

Please sign in to comment.