Back out "always view in lowercase" part

Return to previous variant "comparing in lowercase" in winChkName
This commit is contained in:
Andrey A. Chernov 1998-02-24 14:13:16 +00:00
parent 1b2ea87383
commit 5114f1d7c6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=33791
8 changed files with 62 additions and 58 deletions

View File

@ -1,4 +1,4 @@
/* $Id: direntry.h,v 1.9 1998/02/23 09:39:23 ache Exp $ */
/* $Id: direntry.h,v 1.10 1998/02/23 16:44:26 ache Exp $ */
/* $NetBSD: direntry.h,v 1.14 1997/11/17 15:36:32 ws Exp $ */
/*-
@ -130,10 +130,10 @@ struct dirent;
void unix2dostime __P((struct timespec *tsp, u_int16_t *ddp,
u_int16_t *dtp, u_int8_t *dhp));
void dos2unixtime __P((u_int dd, u_int dt, u_int dh, struct timespec *tsp));
int dos2unixfn __P((u_char dn[11], u_char *un, int d2u_loaded, u_int8_t *d2u, int ul_loaded, u_int8_t *ul));
int dos2unixfn __P((u_char dn[11], u_char *un, int lower, int d2u_loaded, u_int8_t *d2u, int ul_loaded, u_int8_t *ul));
int unix2dosfn __P((const u_char *un, u_char dn[12], int unlen, u_int gen, int u2d_loaded, u_int8_t *u2d, int lu_loaded, u_int8_t *lu));
int unix2winfn __P((const u_char *un, int unlen, struct winentry *wep, int cnt, int chksum, int table_loaded, u_int16_t *u2w));
int winChkName __P((const u_char *un, int unlen, struct winentry *wep, int chksum, int u2w_loaded, u_int16_t *u2w, int lu_loaded, u_int8_t *lu));
int winChkName __P((const u_char *un, int unlen, struct winentry *wep, int chksum, int u2w_loaded, u_int16_t *u2w, int ul_loaded, u_int8_t *ul));
int win2unixfn __P((struct winentry *wep, struct dirent *dp, int chksum, int table_loaded, u_int16_t *u2w));
u_int8_t winChksum __P((u_int8_t *name));
int winSlotCnt __P((const u_char *un, int unlen));

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_conv.c,v 1.21 1998/02/23 09:39:24 ache Exp $ */
/* $Id: msdosfs_conv.c,v 1.22 1998/02/23 16:44:27 ache Exp $ */
/* $NetBSD: msdosfs_conv.c,v 1.25 1997/11/17 15:36:40 ws Exp $ */
/*-
@ -387,9 +387,10 @@ l2u[256] = {
* null.
*/
int
dos2unixfn(dn, un, d2u_loaded, d2u, ul_loaded, ul)
dos2unixfn(dn, un, lower, d2u_loaded, d2u, ul_loaded, ul)
u_char dn[11];
u_char *un;
int lower;
int d2u_loaded;
u_int8_t *d2u;
int ul_loaded;
@ -410,8 +411,8 @@ dos2unixfn(dn, un, d2u_loaded, d2u, ul_loaded, ul)
else
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
*un++ = ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c];
*un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
dn++;
/*
@ -421,8 +422,8 @@ dos2unixfn(dn, un, d2u_loaded, d2u, ul_loaded, ul)
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
dn++;
*un++ = ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c];
*un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
thislong++;
}
dn += 8 - i;
@ -438,8 +439,8 @@ dos2unixfn(dn, un, d2u_loaded, d2u, ul_loaded, ul)
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
dn++;
*un++ = ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c];
*un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
thislong++;
}
}
@ -724,15 +725,15 @@ find_lcode(code, u2w)
* Returns the checksum or -1 if no match
*/
int
winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, lu_loaded, lu)
winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, ul_loaded, ul)
const u_char *un;
int unlen;
struct winentry *wep;
int chksum;
int u2w_loaded;
u_int16_t *u2w;
int lu_loaded;
u_int8_t *lu;
int ul_loaded;
u_int8_t *ul;
{
u_int8_t *cp;
int i;
@ -775,10 +776,10 @@ winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, lu_loaded, lu)
else if (code & 0xff00)
code = '?';
}
c1 = lu_loaded && (code & 0x80) ?
lu[code & 0x7f] : l2u[code];
c2 = lu_loaded && (*un & 0x80) ?
lu[*un & 0x7f] : l2u[*un];
c1 = ul_loaded && (code & 0x80) ?
ul[code & 0x7f] : u2l[code];
c2 = ul_loaded && (*un & 0x80) ?
ul[*un & 0x7f] : u2l[*un];
if (c1 != c2)
return -1;
cp += 2;
@ -797,10 +798,10 @@ winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, lu_loaded, lu)
else if (code & 0xff00)
code = '?';
}
c1 = lu_loaded && (code & 0x80) ?
lu[code & 0x7f] : l2u[code];
c2 = lu_loaded && (*un & 0x80) ?
lu[*un & 0x7f] : l2u[*un];
c1 = ul_loaded && (code & 0x80) ?
ul[code & 0x7f] : u2l[code];
c2 = ul_loaded && (*un & 0x80) ?
ul[*un & 0x7f] : u2l[*un];
if (c1 != c2)
return -1;
cp += 2;
@ -819,10 +820,10 @@ winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, lu_loaded, lu)
else if (code & 0xff00)
code = '?';
}
c1 = lu_loaded && (code & 0x80) ?
lu[code & 0x7f] : l2u[code];
c2 = lu_loaded && (*un & 0x80) ?
lu[*un & 0x7f] : l2u[*un];
c1 = ul_loaded && (code & 0x80) ?
ul[code & 0x7f] : u2l[code];
c2 = ul_loaded && (*un & 0x80) ?
ul[*un & 0x7f] : u2l[*un];
if (c1 != c2)
return -1;
cp += 2;

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_lookup.c,v 1.19 1998/02/23 09:39:25 ache Exp $ */
/* $Id: msdosfs_lookup.c,v 1.20 1998/02/23 16:44:30 ache Exp $ */
/* $NetBSD: msdosfs_lookup.c,v 1.37 1997/11/17 15:36:54 ws Exp $ */
/*-
@ -261,7 +261,7 @@ msdosfs_lookup(ap)
pmp->pm_flags & MSDOSFSMNT_U2WTABLE,
pmp->pm_u2w,
pmp->pm_flags & MSDOSFSMNT_ULTABLE,
pmp->pm_lu);
pmp->pm_ul);
continue;
}

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_vnops.c,v 1.59 1998/02/23 09:39:27 ache Exp $ */
/* $Id: msdosfs_vnops.c,v 1.60 1998/02/23 16:44:36 ache Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */
/*-
@ -1743,6 +1743,7 @@ msdosfs_readdir(ap)
if (chksum != winChksum(dentp->deName))
dirbuf.d_namlen = dos2unixfn(dentp->deName,
(u_char *)dirbuf.d_name,
pmp->pm_flags & MSDOSFSMNT_SHORTNAME,
pmp->pm_flags & MSDOSFSMNT_U2WTABLE,
pmp->pm_d2u,
pmp->pm_flags & MSDOSFSMNT_ULTABLE,

View File

@ -1,4 +1,4 @@
/* $Id: direntry.h,v 1.9 1998/02/23 09:39:23 ache Exp $ */
/* $Id: direntry.h,v 1.10 1998/02/23 16:44:26 ache Exp $ */
/* $NetBSD: direntry.h,v 1.14 1997/11/17 15:36:32 ws Exp $ */
/*-
@ -130,10 +130,10 @@ struct dirent;
void unix2dostime __P((struct timespec *tsp, u_int16_t *ddp,
u_int16_t *dtp, u_int8_t *dhp));
void dos2unixtime __P((u_int dd, u_int dt, u_int dh, struct timespec *tsp));
int dos2unixfn __P((u_char dn[11], u_char *un, int d2u_loaded, u_int8_t *d2u, int ul_loaded, u_int8_t *ul));
int dos2unixfn __P((u_char dn[11], u_char *un, int lower, int d2u_loaded, u_int8_t *d2u, int ul_loaded, u_int8_t *ul));
int unix2dosfn __P((const u_char *un, u_char dn[12], int unlen, u_int gen, int u2d_loaded, u_int8_t *u2d, int lu_loaded, u_int8_t *lu));
int unix2winfn __P((const u_char *un, int unlen, struct winentry *wep, int cnt, int chksum, int table_loaded, u_int16_t *u2w));
int winChkName __P((const u_char *un, int unlen, struct winentry *wep, int chksum, int u2w_loaded, u_int16_t *u2w, int lu_loaded, u_int8_t *lu));
int winChkName __P((const u_char *un, int unlen, struct winentry *wep, int chksum, int u2w_loaded, u_int16_t *u2w, int ul_loaded, u_int8_t *ul));
int win2unixfn __P((struct winentry *wep, struct dirent *dp, int chksum, int table_loaded, u_int16_t *u2w));
u_int8_t winChksum __P((u_int8_t *name));
int winSlotCnt __P((const u_char *un, int unlen));

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_conv.c,v 1.21 1998/02/23 09:39:24 ache Exp $ */
/* $Id: msdosfs_conv.c,v 1.22 1998/02/23 16:44:27 ache Exp $ */
/* $NetBSD: msdosfs_conv.c,v 1.25 1997/11/17 15:36:40 ws Exp $ */
/*-
@ -387,9 +387,10 @@ l2u[256] = {
* null.
*/
int
dos2unixfn(dn, un, d2u_loaded, d2u, ul_loaded, ul)
dos2unixfn(dn, un, lower, d2u_loaded, d2u, ul_loaded, ul)
u_char dn[11];
u_char *un;
int lower;
int d2u_loaded;
u_int8_t *d2u;
int ul_loaded;
@ -410,8 +411,8 @@ dos2unixfn(dn, un, d2u_loaded, d2u, ul_loaded, ul)
else
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
*un++ = ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c];
*un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
dn++;
/*
@ -421,8 +422,8 @@ dos2unixfn(dn, un, d2u_loaded, d2u, ul_loaded, ul)
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
dn++;
*un++ = ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c];
*un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
thislong++;
}
dn += 8 - i;
@ -438,8 +439,8 @@ dos2unixfn(dn, un, d2u_loaded, d2u, ul_loaded, ul)
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
dn++;
*un++ = ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c];
*un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
thislong++;
}
}
@ -724,15 +725,15 @@ find_lcode(code, u2w)
* Returns the checksum or -1 if no match
*/
int
winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, lu_loaded, lu)
winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, ul_loaded, ul)
const u_char *un;
int unlen;
struct winentry *wep;
int chksum;
int u2w_loaded;
u_int16_t *u2w;
int lu_loaded;
u_int8_t *lu;
int ul_loaded;
u_int8_t *ul;
{
u_int8_t *cp;
int i;
@ -775,10 +776,10 @@ winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, lu_loaded, lu)
else if (code & 0xff00)
code = '?';
}
c1 = lu_loaded && (code & 0x80) ?
lu[code & 0x7f] : l2u[code];
c2 = lu_loaded && (*un & 0x80) ?
lu[*un & 0x7f] : l2u[*un];
c1 = ul_loaded && (code & 0x80) ?
ul[code & 0x7f] : u2l[code];
c2 = ul_loaded && (*un & 0x80) ?
ul[*un & 0x7f] : u2l[*un];
if (c1 != c2)
return -1;
cp += 2;
@ -797,10 +798,10 @@ winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, lu_loaded, lu)
else if (code & 0xff00)
code = '?';
}
c1 = lu_loaded && (code & 0x80) ?
lu[code & 0x7f] : l2u[code];
c2 = lu_loaded && (*un & 0x80) ?
lu[*un & 0x7f] : l2u[*un];
c1 = ul_loaded && (code & 0x80) ?
ul[code & 0x7f] : u2l[code];
c2 = ul_loaded && (*un & 0x80) ?
ul[*un & 0x7f] : u2l[*un];
if (c1 != c2)
return -1;
cp += 2;
@ -819,10 +820,10 @@ winChkName(un, unlen, wep, chksum, u2w_loaded, u2w, lu_loaded, lu)
else if (code & 0xff00)
code = '?';
}
c1 = lu_loaded && (code & 0x80) ?
lu[code & 0x7f] : l2u[code];
c2 = lu_loaded && (*un & 0x80) ?
lu[*un & 0x7f] : l2u[*un];
c1 = ul_loaded && (code & 0x80) ?
ul[code & 0x7f] : u2l[code];
c2 = ul_loaded && (*un & 0x80) ?
ul[*un & 0x7f] : u2l[*un];
if (c1 != c2)
return -1;
cp += 2;

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_lookup.c,v 1.19 1998/02/23 09:39:25 ache Exp $ */
/* $Id: msdosfs_lookup.c,v 1.20 1998/02/23 16:44:30 ache Exp $ */
/* $NetBSD: msdosfs_lookup.c,v 1.37 1997/11/17 15:36:54 ws Exp $ */
/*-
@ -261,7 +261,7 @@ msdosfs_lookup(ap)
pmp->pm_flags & MSDOSFSMNT_U2WTABLE,
pmp->pm_u2w,
pmp->pm_flags & MSDOSFSMNT_ULTABLE,
pmp->pm_lu);
pmp->pm_ul);
continue;
}

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_vnops.c,v 1.59 1998/02/23 09:39:27 ache Exp $ */
/* $Id: msdosfs_vnops.c,v 1.60 1998/02/23 16:44:36 ache Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */
/*-
@ -1743,6 +1743,7 @@ msdosfs_readdir(ap)
if (chksum != winChksum(dentp->deName))
dirbuf.d_namlen = dos2unixfn(dentp->deName,
(u_char *)dirbuf.d_name,
pmp->pm_flags & MSDOSFSMNT_SHORTNAME,
pmp->pm_flags & MSDOSFSMNT_U2WTABLE,
pmp->pm_d2u,
pmp->pm_flags & MSDOSFSMNT_ULTABLE,