Skip to content

Commit 1baf80d

Browse files
committed
change to match win95 and charpreva behavior
1 parent 69d23c0 commit 1baf80d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

user/user.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3834,9 +3834,17 @@ SEGPTR WINAPI AnsiNext16(SEGPTR current)
38343834
SEGPTR WINAPI AnsiPrev16( SEGPTR sstart, SEGPTR current )
38353835
{
38363836
char *ptr = MapSL(current);
3837+
SEGPTR sptr = current - 1;
3838+
ptr--;
38373839
if (sstart == current) return current;
3838-
if ((sstart != (current - 1)) && IsDBCSLeadByte(*(ptr - 2))) return current - 2;
3839-
return current - 1;
3840+
while (sptr != sstart)
3841+
{
3842+
ptr--;
3843+
if (!IsDBCSLeadByte(*ptr)) break;
3844+
sptr--;
3845+
}
3846+
if ((current - sptr) & 1) return current - 1;
3847+
return current - 2;
38403848
}
38413849

38423850

0 commit comments

Comments
 (0)