diff options
author | maxim <maxim@FreeBSD.org> | 2006-11-26 18:49:44 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2006-11-26 18:49:44 +0000 |
commit | 24b0d3f0fdb86f7a4f9ecc9d9a8d01046094ed63 (patch) | |
tree | a6603853e489174c61b140a56af8e3748cfd3747 /sys/fs/msdosfs | |
parent | 8f2b5bd800be4781a09beff0785b6de9f437d176 (diff) | |
download | FreeBSD-src-24b0d3f0fdb86f7a4f9ecc9d9a8d01046094ed63.zip FreeBSD-src-24b0d3f0fdb86f7a4f9ecc9d9a8d01046094ed63.tar.gz |
o From the submitter: dos2unixchr will convert to lower case if
LCASE_BASE or LCASE_EXT or both are set. But dos2unixfn uses
dos2unixchr separately for the basename and the extension. So if
either LCASE_BASE or LCASE_EXT is set, dos2unixfn will convert both
the basename and extension to lowercase because it is blindly
passing in the state of both flags to dos2unixchr. The bit masks I
used ensure that only the state of LCASE_BASE gets passed to
dos2unixchr when the basename is converted, and only the state of
LCASE_EXT is passed in when the extension is converted.
PR: kern/86655
Submitted by: Micah Lieske
MFC after: 3 weeks
Diffstat (limited to 'sys/fs/msdosfs')
-rw-r--r-- | sys/fs/msdosfs/msdosfs_conv.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c index bde92fd..4c85169 100644 --- a/sys/fs/msdosfs/msdosfs_conv.c +++ b/sys/fs/msdosfs/msdosfs_conv.c @@ -270,7 +270,8 @@ dos2unixfn(dn, un, lower, pmp) * Copy the name portion into the unix filename string. */ for (i = 8; i > 0 && *dn != ' ';) { - c = dos2unixchr((const u_char **)&dn, &i, lower, pmp); + c = dos2unixchr((const u_char **)&dn, &i, lower & LCASE_BASE, + pmp); if (c & 0xff00) { *un++ = c >> 8; thislong++; @@ -288,7 +289,8 @@ dos2unixfn(dn, un, lower, pmp) *un++ = '.'; thislong++; for (i = 3; i > 0 && *dn != ' ';) { - c = dos2unixchr((const u_char **)&dn, &i, lower, pmp); + c = dos2unixchr((const u_char **)&dn, &i, + lower & LCASE_EXT, pmp); if (c & 0xff00) { *un++ = c >> 8; thislong++; |