Revert cobol file creation and parameter validation changes
Reverts a change that incorrectly added a trailing null to filenames and relied on incorrect filename length validation.
This commit reverts a previous change to cobol’s CBL_CREATE_FILE function. The revert corrects an issue where filenames were being created with an unintended trailing null character (e.g., ‘myfile.txt0’). It also removes filename length validation that incorrectly relied on hardcoded values, as the kernel already handles this by returning ENAMETOOLONG.
In Details
Reverts GCC commit removing a null termination from filenames passed to posix-open in libgcobol's CBL_CREATE_FILE. Also removes a filename length check that incorrectly relied on MAX_FILENAME, letting the kernel's ENAMETOOLONG handle it. This corrects a bug where files were created with an extra trailing '0'.
- CBL_CREATE_FILE
- A COBOL intrinsic or library function used to create files.
- posix-open
- A function that opens a file using POSIX standards, returning an error like ENAMETOOLONG for excessively long filenames.
- ENAMETOOLONG
- An error code indicating that a filename or path exceeds the system's maximum allowed length.