1
0
mirror of https://github.com/cc65/cc65.git synced 2025-04-18 09:38:07 +00:00

Don't set errno when the regular end of directory is reached. Plus minor code

cleanup.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5677 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2012-06-03 15:31:19 +00:00
parent c40b54ee6c
commit 2a53124b15

@ -52,18 +52,17 @@ struct dirent* __fastcall__ readdir (register DIR* dir)
}
}
/* End of directory is reached if the buffer contains "blocks free". It is
* sufficient here to check for the leading 'b'. To avoid problems if we're
* called again, read until end of directory.
*/
if (count > 0 && buffer[0] == 'b') {
while (_dirread1 (dir, buffer)) ;
return 0;
}
/* Bump the directory offset */
dir->off += count;
/* End of directory is reached if the buffer contains "blocks free". It is
* sufficient here to check for the leading 'b'. buffer will contain at
* least one byte if we come here.
*/
if (buffer[0] == 'b') {
goto exitpoint;
}
/* Parse the buffer for the filename and file type */
i = 0;
j = 0;