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