mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-18 08:25:34 +00:00
The extension check counted bytes back from the end of the name and
sliced there, which panics when that offset falls inside a character:
(file.rename {"name": "abecde"} with a combining accent, .docm)
byte index 3 is not a char boundary; it is inside 'e' (bytes 2..4)
Splitting at the name's own last dot asks the same question without an
arithmetic offset, and reads the same for every name. Covered for a name
with no extension and one with the document's, both multi-byte.