tkchia / newlib-ia16

Fork of IA-16 port of Newlib -- added small and medium model support
GNU General Public License v2.0
13 stars 4 forks source link

Make realpath (...) and friends properly handle file names with multi-byte characters #17

Closed tkchia closed 2 years ago

tkchia commented 2 years ago

At least under the Japanese version of MS-DOS, apparently it is very possible for file name components to contain e.g. a "backslash" byte element ('\x5c'), if it occurs as part of a multi-byte character sequence.

realpath (...) and _stat_r (...) should really be updated to handle such cases. Rather than just looking at each byte individually as a character, they should take into account the active DOS code page.

Functions in libi86 should probably also be updated.

tkchia commented 2 years ago

Fixed with