zeroc-ice / vscode-slice

Slice syntax highlighter for Visual Studio Code
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

Sanitize File Paths #43

Closed InsertCreativityHere closed 5 months ago

InsertCreativityHere commented 5 months ago

This PR adds a new function: sanitize_path.

There are two implementations of the function, which are selected based on the target-os we're compiling for. The Unix/Mac version does nothing. The Windows version:

All of the places where we receive a path from the client use this function now, instead of half-sanitizing them using chains of 'to_file_path', 'from_file_path', etc.


The actual function is at the end of this PR. If you could really give it a proper look it'd be appreciated. Doing string manipulation based on character indexes is always prone for fun bugs : vP