version 1.2 | | version 1.3 |
---|
| | |
if (dp->offset != 0) { | | if (dp->offset != 0) { |
if (_findnext(dp->handle, &(dp->fileinfo)) < 0) { | | if (_findnext(dp->handle, &(dp->fileinfo)) < 0) { |
dp->finished = 1; | | dp->finished = 1; |
| | if (ENOENT == errno) |
| | /* Clear error set to mean no more files else that breaks things */ |
| | errno = 0; |
return NULL; | | return NULL; |
} | | } |
} | | } |
| | |
| | |
strncpy(dp->dent.d_name, dp->fileinfo.name, _MAX_FNAME); | | strncpy(dp->dent.d_name, dp->fileinfo.name, _MAX_FNAME); |
dp->dent.d_ino = 1; | | dp->dent.d_ino = 1; |
dp->dent.d_reclen = strlen(dp->dent.d_name); | | /* reclen is used as meaning the length of the whole record */ |
| | dp->dent.d_reclen = strlen(dp->dent.d_name) + sizeof(char) + sizeof(dp->dent.d_ino) + sizeof(dp->dent.d_reclen) + sizeof(dp->dent.d_off); |
dp->dent.d_off = dp->offset; | | dp->dent.d_off = dp->offset; |
| | |
return &(dp->dent); | | return &(dp->dent); |