Finish adosfs' support for International FFS (we not only have to use an
internationalized hash function to search for files, but also to use an internationalized compare to compare the candidates). This also removes one use of strcasecmp() in the kernel.
This commit is contained in:
parent
452b12520a
commit
ab97b65e37
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: adlookup.c,v 1.13 1996/04/05 05:06:07 mhitch Exp $ */
|
||||
/* $NetBSD: adlookup.c,v 1.14 1996/05/24 20:16:02 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
@ -40,11 +40,11 @@
|
||||
#include <adosfs/adosfs.h>
|
||||
|
||||
#ifdef ADOSFS_EXACTMATCH
|
||||
#define strmatch(s1, l1, s2, l2) \
|
||||
#define strmatch(s1, l1, s2, l2, i) \
|
||||
((l1) == (l2) && bcmp((s1), (s2), (l1)) == 0)
|
||||
#else
|
||||
#define strmatch(s1, l1, s2, l2) \
|
||||
((l1) == (l2) && strncasecmp((s1), (s2), (l1)) == 0)
|
||||
#define strmatch(s1, l1, s2, l2, i) \
|
||||
((l1) == (l2) && adoscaseequ((s1), (s2), (l1), (i)))
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -213,7 +213,8 @@ adosfs_lookup(v)
|
||||
adp->tabi[hval] = -adp->tabi[hval];
|
||||
}
|
||||
}
|
||||
if (strmatch(pelt, plen, ap->name, strlen(ap->name)))
|
||||
if (strmatch(pelt, plen, ap->name, strlen(ap->name),
|
||||
IS_INTER(adp->amp)))
|
||||
goto found;
|
||||
bn = ap->hashf;
|
||||
vput(*vpp);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: adosfs.h,v 1.10 1996/04/05 05:06:08 mhitch Exp $ */
|
||||
/* $NetBSD: adosfs.h,v 1.11 1996/05/24 20:16:04 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
@ -141,6 +141,7 @@ long adoswordn __P((struct buf *, int));
|
||||
#endif
|
||||
|
||||
long adoscksum __P((struct buf *, long));
|
||||
int adoscaseequ __P((const u_char *, const u_char *, int, int));
|
||||
int adoshash __P((const u_char *, int, int, int));
|
||||
int adunixprot __P((int));
|
||||
int adosfs_getblktype __P((struct adosfsmount *, struct buf *));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: adutil.c,v 1.10 1996/04/23 05:18:29 veego Exp $ */
|
||||
/* $NetBSD: adutil.c,v 1.11 1996/05/24 20:16:05 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
@ -174,6 +174,19 @@ adoscksum(bp, n)
|
||||
return(sum);
|
||||
}
|
||||
|
||||
int
|
||||
adoscaseequ(name1, name2, len, inter)
|
||||
const u_char *name1, *name2;
|
||||
int len;
|
||||
{
|
||||
while (len-- > 0)
|
||||
if (CapitalChar(*name1++, inter) !=
|
||||
CapitalChar(*name2++, inter))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
adoshash(nam, namlen, nelt, inter)
|
||||
const u_char *nam;
|
||||
|
Loading…
Reference in New Issue
Block a user