This resolves issues where saving to and loading from paths with
subdirectories (e.g., "Save\file.asd") would fail.
The original problems were:
1. Writing failure: A path mismatch between directory creation in
commandQE and file writing in fc_open.
2. Loading failure: fc_search could not handle paths containing
directory separators, preventing saved files in subdirectories from
being found.
This commit addresses these issues with the following changes:
- fc_open now automatically creates parent directories when writing a
file.
- fc_search is updated to support two modes:
- It performs a case-insensitive search for simple filenames
(preserving original behavior).
- It performs a case-sensitive existence check for full paths.
Fixes#74.
Rance 5D uses filename `Save\\Rance5dSystem.asd`. This caused issues:
- On Windows, saving would fail if the `Save` directory did not exist.
- On other platforms, files were created with literal backslashes in
their names.
This change addresses these problems by:
- In commandQE, normalizing backslashes to forward slashes in the path
and ensuring that the target directory exists by calling mkdir_p().
- In commandLE, first attempting to load files with normalized forward
slashes. If that fails, it retries with the original path (containing
backslashes) for compatibility with older saves.
- Use _wfopen on Windows, to avoid garbled filenames.
- The -savekanji option is removed. Now character encoding of file paths
is assumed to be UTF-8 on non-windows.
- On all platforms, data files are also searched for in current
directory.