cvs commit: src/sys/fs/msdosfs msdosfs_conv.c
R. Imura
imura at FreeBSD.org
Sun Jul 17 07:10:06 GMT 2005
imura 2005-07-17 07:10:05 UTC
FreeBSD src repository
Modified files:
sys/fs/msdosfs msdosfs_conv.c
Log:
[1] unix2doschr()
If a character cannot be converted to DOS code page,
unix2doschr() returned `0'. As a result, unix2dosfn()
was forced to return `0', so we saw a file which was
composed of these characters as `Invalid argument'.
To correct this, if a character can be converted to
Unicode, unix2doschr() now returns `1' which is a magic
number to make unix2dosfn() know that the character
must be converted to `_'.
[2] unix2dosfn()
The above-mentioned solution only works if a file
has both of Unicode name and DOS code page name.
Unicode name would not be recorded if file name
can be settled within 11 bytes (DOS short name)
and if no conversion from Unix charset to DOS code
page has occurred. Thus, FreeBSD can create a file
which has only short name, but there is no guarantee
that the short name contains allways valid characters
because we leave it to people by using mount_msdosfs(8)
to select which conversion is used between DOS code
page and unix charset.
To avoid this, Unicode file name should be recorded
unless a character is an ascii character. This is
the way Windows XP do.
PR: 77074 [1]
MFC after: 1 week
Revision Changes Path
1.45 +27 -10 src/sys/fs/msdosfs/msdosfs_conv.c
More information about the cvs-src
mailing list