From: uz Date: Sun, 3 Jun 2012 15:01:32 +0000 (+0000) Subject: Fix two place where the directory offset wasn't tracked correctly. X-Git-Tag: V2.14~393 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5f43589885a060707af0bf17388f02b1095a42a8;p=cc65 Fix two place where the directory offset wasn't tracked correctly. git-svn-id: svn://svn.cc65.org/cc65/trunk@5675 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/cbm/readdir.c b/libsrc/cbm/readdir.c index 0a20bdd06..e7b91cc91 100644 --- a/libsrc/cbm/readdir.c +++ b/libsrc/cbm/readdir.c @@ -32,18 +32,21 @@ struct dirent* __fastcall__ readdir (register DIR* dir) /* errno already set */ goto exitpoint; } - dir->off += 2; /* Read the number of blocks */ if (!_dirread (dir, &entry.d_blocks, sizeof (entry.d_blocks))) { goto exitpoint; } + /* Adjust the directory offset */ + dir->off += 4; + /* Read the next file entry into the buffer */ - for (count = 0, b = buffer; count < sizeof (buffer); ++count, ++b) { + for (count = 0, b = buffer; count < sizeof (buffer); ++b) { if (!_dirread1 (dir, b)) { goto exitpoint; } + ++count; if (*b == '\0') { break; }