tVFS_Handle *h = VFS_GetHandle(FD);
char *tmp;
- if(h) return -1;
+ ENTER("ph pDest", h, Dest);
- if(h->Node->ReadDir == NULL) return 0;
+ if(!h || h->Node->ReadDir == NULL) {
+ LEAVE('i', 0);
+ return 0;
+ }
+
+ if(h->Position >= h->Node->Size) {
+ LEAVE('i', 0);
+ return 0;
+ }
tmp = h->Node->ReadDir(h->Node, h->Position);
+ LOG("tmp = '%s'", tmp);
- if(!tmp) return 0;
+ if(!tmp) {
+ LEAVE('i', 0);
+ return 0;
+ }
h->Position ++;
if(IsHeap(tmp)) free(tmp);
+ LEAVE('i', 1);
return 1;
}