Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid normalizing input .ksy paths in stderr and JSON output
See kaitai-io/kaitai_struct#507 Before this commit, the input .ksy paths were normalized as soon as they were parsed from command line arguments, because they were read to `java.io.File` objects. [`java.io.File`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/File.html) objects are subjected to path normalization as soon as they're created, for example on Windows the forward slashes `/` are converted to backslashes `\`, a series of consecutive slashes are collapsed into one on both Unix and Windows systems etc. (See kaitai-io/kaitai_struct#507 (comment) for more details.) Consequently, the .ksy file path for which the compile results are reported may not have matched the original input path. This was particularly noticeable on Windows, where you could only use backslashes (not forward slashes) in the .ksy path passed to `ksv` due to this. As I explain in kaitai-io/kaitai_struct#507 (comment), I believe that treating input paths as opaque strings makes the compiler easier to operate. Now you can pass a bunch of .ksy paths to the compiler and expect to find each path string used exactly as a JSON key in `--ksc-json-output`, without any effects of path normalization mentioned earlier.
- Loading branch information