Commit | Line | Data |
---|---|---|
0befb875 KM |
1 | /* Copyright (c) 1979 Regents of the University of California */ |
2 | ||
86997b19 | 3 | static char sccsid[] = "@(#)UNSYNC.c 1.3 %G%"; |
0befb875 KM |
4 | |
5 | #include "h00vars.h" | |
0befb875 KM |
6 | |
7 | /* | |
8 | * push back last char read to prepare for formatted read | |
9 | */ | |
10 | UNSYNC(curfile) | |
11 | ||
12 | register struct iorec *curfile; | |
13 | { | |
14 | if (curfile->funit & FWRITE) { | |
86997b19 KM |
15 | ERROR("%s: Attempt to read, but open for writing\n", |
16 | curfile->pfname); | |
0befb875 KM |
17 | return; |
18 | } | |
a7f2537e | 19 | if (curfile->funit & EOFF) { |
86997b19 | 20 | ERROR("%s: Tried to read past end of file\n", curfile->pfname); |
a7f2537e KM |
21 | return; |
22 | } | |
0befb875 KM |
23 | if ((curfile->funit & SYNC) == 0) { |
24 | ungetc(*curfile->fileptr, curfile->fbuf); | |
25 | } | |
26 | } |