kernel32: fix incorrect lastpart in GetFullPathNameA with DBCS

Akihiro Sagawa sagawa.aki at gmail.com
Fri Oct 10 10:45:08 CDT 2014


On Thu, 09 Oct 2014 12:03:15 -0500, Aric Stewart wrote:
> ---
>  dlls/kernel32/path.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

Hi Aric,
Thank you for pointing this out, but unfortunately this seems not to be perfect.
Because certain DBCS trail byte range is overlapped its lead byte range
[1].

To demonstrate this issue, I attached additional test. The first case
(0x955c,0x97a0=表裏) is now pass by your patch, but the second one
(0x838f,0x8343,0x8393=ワイン) is failure.

In my opinion, the solution is looking up the path separator from the
beginning of the string like _mbsrchr() in msvcrt.

If you have a further question about this, please contact me.

[1] For CP 932 (Japanese Shift JIS),
   Double byte character:
       Lead byte (first byte):   0x81-0x9f or 0xe0-0xfc, and
       Trail byte (second byte): 0x40-0x7e or 0x80-0xfc.
   Single byte character: 0x00-0x7f, 0xa1-0xdf.

Regards,
Akihiro Sagawa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GetFullPathNameA_test.patch
Type: application/octet-stream
Size: 1772 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141011/833934e4/attachment-0001.obj>


More information about the wine-devel mailing list