Problem
OpenCRG supports master .crg files that reference other .crg files via relative paths. Currently, these paths are resolved relative to the current working directory (CWD) rather than relative to the master .crg file's location. This breaks file references whenever the CWD differs from the master file's directory - which is the common case.
Expected behavior
Relative paths in a .crg file should be resolved relative to the directory containing that .crg file, consistent with how most file formats (e.g., XML, CMake, HTML) handle relative includes.
Proposed fix
When loading a master .crg file with parseFileHeader() in crgLoader, derive the base directory from the master file's path and resolve any referenced relative paths against that base directory instead of the CWD.
Problem
OpenCRG supports master
.crgfiles that reference other.crgfiles via relative paths. Currently, these paths are resolved relative to the current working directory (CWD) rather than relative to the master.crgfile's location. This breaks file references whenever the CWD differs from the master file's directory - which is the common case.Expected behavior
Relative paths in a
.crgfile should be resolved relative to the directory containing that.crgfile, consistent with how most file formats (e.g., XML, CMake, HTML) handle relative includes.Proposed fix
When loading a master
.crgfile withparseFileHeader()in crgLoader, derive the base directory from the master file's path and resolve any referenced relative paths against that base directory instead of the CWD.