diff options
author | joerg <joerg@FreeBSD.org> | 1997-12-02 21:13:59 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1997-12-02 21:13:59 +0000 |
commit | 8b0ccba9ec3bcdeb9faefafee5ae3f00d88d708f (patch) | |
tree | 12254cfd4ecd1e4903aed22c651e1420162745a0 | |
parent | a1bfb618d996ea613b9d640d00950f5ffef739db (diff) | |
download | FreeBSD-src-8b0ccba9ec3bcdeb9faefafee5ae3f00d88d708f.zip FreeBSD-src-8b0ccba9ec3bcdeb9faefafee5ae3f00d88d708f.tar.gz |
Fix a bug that caused cdboot to stop reading the root directory at the
end of the first block.
Problem found by: Kenneth Merry <ken@plutotech.com>
-rw-r--r-- | sys/i386/boot/cdboot/cdrom.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/i386/boot/cdboot/cdrom.c b/sys/i386/boot/cdboot/cdrom.c index 03081d9..23d51b7 100644 --- a/sys/i386/boot/cdboot/cdrom.c +++ b/sys/i386/boot/cdboot/cdrom.c @@ -27,7 +27,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id$ + * $Id: cdrom.c,v 1.1 1997/07/11 05:52:39 joerg Exp $ */ @@ -234,8 +234,18 @@ find(const char *path, int list_only) i, (int)(ptr - rootdirbuf), entrylen, entrylen)); if (entrylen == 0) { - DPRINTF(("EOD\n")); - break; + /* + * Dir entry of length 0. That's the last + * entry in this block, advance to the next + * block (if any). In case we get beyond the + * end of the directory, we'll fall off the + * loop due to the rootdirsize condition in + * the `for' statement. + */ + DPRINTF(("entrylen 0\n")); + entrylen = (~((ptr - rootdirbuf) + BLKSIZE - 1)) + & (BLKSIZE - 1); + continue; } if (len == 0) { DPRINTF(("name_len 0\n")); |