mirror of
https://github.com/cc65/cc65.git
synced 2024-12-27 00:29:31 +00:00
Add support for pushed back chars
git-svn-id: svn://svn.cc65.org/cc65/trunk@3033 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
8f7b91eea6
commit
35aea65c61
@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
|
||||
int __fastcall__ fgetc (FILE* f)
|
||||
int __fastcall__ fgetc (register FILE* f)
|
||||
{
|
||||
unsigned char c;
|
||||
|
||||
@ -29,7 +29,13 @@ int __fastcall__ fgetc (FILE* f)
|
||||
return EOF;
|
||||
}
|
||||
|
||||
/* Read the byte */
|
||||
/* If we have a pushed back character, return it */
|
||||
if (f->f_flags & _FPUSHBACK) {
|
||||
f->f_flags &= ~_FPUSHBACK;
|
||||
return f->f_pushback;
|
||||
}
|
||||
|
||||
/* Read one byte */
|
||||
switch (read (f->f_fd, &c, 1)) {
|
||||
|
||||
case -1:
|
||||
|
Loading…
Reference in New Issue
Block a user