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:
replaces forward slashes with bask-slashes
if there's a disk prefix, we ensure it's capitalized
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
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