From 1fa79b09dea9f19fab2e321ef630db8309abfcc9 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 19 Oct 2004 18:28:41 +0000 Subject: Got rid of ungetc() to save Chrilith from the trouble of implementing it himself on PalmOS. svn-id: r15616 --- common/file.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'common/file.cpp') 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; } -- cgit v1.2.3