From 51a962e341aeac6745b424226191d4d7e1f6d431 Mon Sep 17 00:00:00 2001 From: ws Date: Thu, 16 Sep 1993 16:54:09 +0000 Subject: [PATCH] Bug fix in compare routine for correct sorting order. But at the same time disable sorting optimization, as there are a lot of CDs with incorrectly sorted directory records. --- sys/isofs/isofs_lookup.c | 4 +++- sys/isofs/isofs_util.c | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/isofs/isofs_lookup.c b/sys/isofs/isofs_lookup.c index 606bfa5099e4..937f978ef8ff 100644 --- a/sys/isofs/isofs_lookup.c +++ b/sys/isofs/isofs_lookup.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)ufs_lookup.c 7.33 (Berkeley) 5/19/91 - * $Id: isofs_lookup.c,v 1.7 1993/09/07 15:40:54 ws Exp $ + * $Id: isofs_lookup.c,v 1.8 1993/09/16 16:54:09 ws Exp $ */ #include "param.h" @@ -285,10 +285,12 @@ searchloop: saveoffset = ndp->ni_ufs.ufs_offset; } else if (ino) goto foundino; +#ifdef NOSORTBUG /* On some CDs directory entries are not sorted correctly */ else if (res < 0) goto notfound; else if (res > 0 && numdirpasses == 2) numdirpasses++; +#endif } break; case ISO_FTYPE_RRIP: diff --git a/sys/isofs/isofs_util.c b/sys/isofs/isofs_util.c index 738d18697424..e00a4e14c729 100644 --- a/sys/isofs/isofs_util.c +++ b/sys/isofs/isofs_util.c @@ -1,5 +1,5 @@ /* - * $Id: isofs_util.c,v 1.5 1993/09/07 15:40:59 ws Exp $ + * $Id: isofs_util.c,v 1.6 1993/09/16 16:54:10 ws Exp $ */ #include "param.h" #include "systm.h" @@ -146,8 +146,12 @@ isofncmp(unsigned char *fn,int fnlen,unsigned char *isofn,int isolen) } if (c != *fn) { if (c >= 'A' && c <= 'Z') { - if ((c += ('a' - 'A')) != *fn) - return *fn - c; + if (c + ('a' - 'A') != *fn) { + if (*fn >= 'a' && *fn <= 'z') + return *fn - ('a' - 'A') - c; + else + return *fn - c; + } } else return *fn - c; }