Fixed CharNextA/CharNextExA for DBCS.

This commit is contained in:
Hidenori Takeshima 2000-02-25 21:34:48 +00:00 committed by Alexandre Julliard
parent 1758f2d81a
commit 45daffaafe
1 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ SEGPTR WINAPI AnsiPrev16( SEGPTR start, SEGPTR current )
LPSTR WINAPI CharNextA( LPCSTR ptr ) LPSTR WINAPI CharNextA( LPCSTR ptr )
{ {
if (!*ptr) return (LPSTR)ptr; if (!*ptr) return (LPSTR)ptr;
if (IsDBCSLeadByte( *ptr )) return (LPSTR)(ptr + 2); if (IsDBCSLeadByte( *ptr ) && (*(ptr+1) != 0) ) return (LPSTR)(ptr + 2);
return (LPSTR)(ptr + 1); return (LPSTR)(ptr + 1);
} }
@ -192,7 +192,7 @@ LPSTR WINAPI CharNextA( LPCSTR ptr )
LPSTR WINAPI CharNextExA( WORD codepage, LPCSTR ptr, DWORD flags ) LPSTR WINAPI CharNextExA( WORD codepage, LPCSTR ptr, DWORD flags )
{ {
if (!*ptr) return (LPSTR)ptr; if (!*ptr) return (LPSTR)ptr;
if (IsDBCSLeadByteEx( codepage, *ptr )) return (LPSTR)(ptr + 2); if (IsDBCSLeadByteEx( codepage, *ptr ) && (*(ptr+1) != 0) ) return (LPSTR)(ptr + 2);
return (LPSTR)(ptr + 1); return (LPSTR)(ptr + 1);
} }