RamonUnch / GreenPad

Fork from roytam1 fork from original GreenPad
21 stars 0 forks source link

GreenPad crash when opening check.t in Win95 OSR2 #178

Closed roytam1 closed 8 months ago

roytam1 commented 8 months ago

Test file: https://github.com/MirBSD/mksh/raw/master/check.t and it hangs in my build.

tested with latest release(1.20): image image

RamonUnch commented 8 months ago

Strange. I was able to reproduce on Windows 95 OSR2.5 and also when using a slightly older build, did not test the original though. I will install VC++6 on Windows 95 when I get time, and see if I can find the crash in the debugger. Probably we are giving improper parameters to some GDI functions in some cases. When I try to Load the file as Latin1 it does not crash, only when using UTF-8 or UTF-5 does it crashes.

RamonUnch commented 8 months ago

If I force the use of TextOutA over TextOutW I no longer get the crash. So maybe it is GDI that really does not like some Unicode sequences, or maybe something else is wrong.

RamonUnch commented 8 months ago

GetCharWidthW() actually crashes if you ask the width of U+FFFF.

roytam1 commented 8 months ago

GetCharWidthW() actually crashes if you ask the width of U+FFFF.

so I fixed my side with different approach: https://github.com/roytam1/rtoss/commit/fe3fa17fa2020498280346c92c4effa94e9d8452