1) bug fix on nativeavailable(): forgot to get back the file pointer to the current...
[IRC.git] / Robust / src / Runtime / file.c
index c8997a10601eff191ac8571c45fde704a8ad2b3b..0eb7d901d1628489da087b24d6147c72aca19916 100644 (file)
@@ -153,6 +153,7 @@ int CALL11(___FileInputStream______nativeAvailable____I, int fd, int fd) {
   int avail;
   int cur=lseek(fd, 0, SEEK_CUR);
   int fsize = lseek(fd, 0, SEEK_END);
+  lseek(fd,cur,SEEK_SET); // seek back to the current position
   avail=fsize-cur;
   return avail;
 #endif