We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69d23c0 commit 1baf80dCopy full SHA for 1baf80d
user/user.c
@@ -3834,9 +3834,17 @@ SEGPTR WINAPI AnsiNext16(SEGPTR current)
3834
SEGPTR WINAPI AnsiPrev16( SEGPTR sstart, SEGPTR current )
3835
{
3836
char *ptr = MapSL(current);
3837
+ SEGPTR sptr = current - 1;
3838
+ ptr--;
3839
if (sstart == current) return current;
- if ((sstart != (current - 1)) && IsDBCSLeadByte(*(ptr - 2))) return current - 2;
- return current - 1;
3840
+ while (sptr != sstart)
3841
+ {
3842
3843
+ if (!IsDBCSLeadByte(*ptr)) break;
3844
+ sptr--;
3845
+ }
3846
+ if ((current - sptr) & 1) return current - 1;
3847
+ return current - 2;
3848
}
3849
3850
0 commit comments