pic_fflush and pic_ffill should change cursor positions
This commit is contained in:
parent
a5f478a7d5
commit
f564626556
12
src/port.c
12
src/port.c
|
@ -69,13 +69,21 @@ pic_setvbuf(pic_file *file, char *buf, int mode, size_t bufsiz)
|
||||||
int
|
int
|
||||||
pic_fflush(pic_file *file)
|
pic_fflush(pic_file *file)
|
||||||
{
|
{
|
||||||
return file->vtable.write(file->vtable.cookie, file->s, file->c - file->s);
|
int r;
|
||||||
|
|
||||||
|
r = file->vtable.write(file->vtable.cookie, file->s, file->c - file->s);
|
||||||
|
file->c -= r;
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pic_ffill(pic_file *file)
|
pic_ffill(pic_file *file)
|
||||||
{
|
{
|
||||||
return file->vtable.read(file->vtable.cookie, file->c, file->e - file->c);
|
int r;
|
||||||
|
|
||||||
|
r = file->vtable.read(file->vtable.cookie, file->c, file->e - file->c);
|
||||||
|
file->c += r;
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
pic_file *
|
pic_file *
|
||||||
|
|
Loading…
Reference in New Issue