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.
This commit is contained in:
ws 1993-09-16 16:54:09 +00:00
parent 2f7cd59af8
commit 51a962e341
2 changed files with 10 additions and 4 deletions

View File

@ -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:

View File

@ -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;
}