diff options
-rw-r--r-- | common/file.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/file.cpp b/common/file.cpp index 63073239df..d264574a17 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -318,8 +318,10 @@ char *File::gets(void *ptr, uint32 len) { if (c == CR) { c = getc(_handle); - if (c != LF) - ungetc(c, _handle); + // Don't use ungetc() here. It might be slightly more + // elegant, but PalmOS doesn't have it. + if (c != LF && c != EOF) + fseek(_handle, -1, SEEK_CUR); break; } |