Commit Graph

3 Commits

Author SHA1 Message Date
9feb3b4cd7 gamedata_xml: prefilter the report path guard
An existing regular report with one link and a non-input basename cannot alias a scanned XML, index.json or carve stream. Skip the per-file same_report_path loop for it; missing paths, links, input-like names, explicit file targets and symlinked inputs are still compared.
2026-11-22 20:09:48 +00:00
70dbedc196 gamedata_xml: refuse reports that alias a nested input 2026-11-22 17:34:14 +00:00
655a2e06d8 gamedata_xml: report paths create their folder and cannot clobber inputs
--csv and --json are opened after the scan, so a missing folder lost the
result to a FileNotFoundError, a path that resolved to a carve index (or
to an XML target) replaced the input, and an existing directory ended in
a PermissionError traceback. Port navmesh_decode.py's pattern: create the
report parent, reject a directory report path, and reject report paths
that same_report_path() matches against every target (or
<dir>/index.json); also refuse identical --csv/--json paths.

New tests/test_gamedata_xml_report_paths.py covers all of it; main's
tool fails seven of the eight cases as the negative control.
2026-11-22 18:49:30 +08:00