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:
@@ -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 */
|
/* Bump the directory offset */
|
||||||
dir->off += count;
|
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 */
|
/* Parse the buffer for the filename and file type */
|
||||||
i = 0;
|
i = 0;
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user