cobol: Ignore CDF paths for absolute copybook names.
GCC's COBOL compiler now correctly handles absolute copybook names, ignoring intervening search paths.
The GCC COBOL compiler has been updated to correctly interpret absolute copybook names. Previously, the compiler might have incorrectly tried to resolve paths for copybooks specified with a leading slash, which signifies an absolute path. This change ensures that the copybook_elem_t::open_file function recognizes leading slashes and does not prepend search paths, allowing for correct inclusion of copybooks regardless of the current directory or compiler search path settings.
In Details
In COBOL, COPY statements include code from other files (copybooks). When a copybook name is absolute (e.g., /path/to/copybook.cpy), the compiler should not prepend its configured copybook directory (CDF) paths. This commit modifies cdf-copy.cc to correctly identify and handle such absolute paths by checking for a leading slash, preventing incorrect search path concatenation.
- copybook
- A file in COBOL containing data definitions or procedure divisions that can be included in multiple programs using the
COPYstatement. - CDF
- Copybook Directory Facility or similar mechanism within the COBOL compiler that manages and searches for copybook files.