Skip to content

Commit

Permalink
Reimplement filestream_eof
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Dec 11, 2017
1 parent 3251109 commit 5b8f8b5
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions libretro-common/streams/file_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,26 +366,12 @@ ssize_t filestream_seek(RFILE *stream, ssize_t offset, int whence)

int filestream_eof(RFILE *stream)
{
return feof(stream->fp);

/* TODO: FIXME: I can't figure out why this breaks on Windows.
The while loop in config_file_new_internal just never exits.
The current position seems to jump backwards a few lines,
but it doesn't start until somewhere in the middle of the file.
*/
/*
size_t current_position = filestream_tell(stream);
size_t end_position;
filestream_seek(stream, 0, SEEK_END);
end_position = filestream_tell(stream);
filestream_seek(stream, current_position, SEEK_SET);
int64_t current_position = filestream_tell(stream);
int64_t end_position = filestream_get_size(stream);

if (current_position >= end_position)
return 1;
return 0;
*/
}

ssize_t filestream_tell(RFILE *stream)
Expand Down

0 comments on commit 5b8f8b5

Please sign in to comment.