Skip to content

This PR fixes logic bugs in cecb cassette tape handling, properly r… - #80

Merged
tlindner merged 1 commit into
nitros9project:mainfrom
tlindner:cecb-fix3
Aug 3, 2026
Merged

tlindner merged 1 commit into
nitros9project:mainfrom
tlindner:cecb-fix3

Conversation

@tlindner

@tlindner tlindner commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

This PR fixes logic bugs in cecb cassette tape handling, properly reports missing file errors during _cecb_open, updates function signatures to use const qualifiers, and adds missing error string mappings to libtoolshed.

Changes Included

  • Fix WAV extension validation in cecbbulkerase: Inverted the check on strendcasecmp so that non-WAV files are correctly skipped rather than skipping valid WAV files.
  • Handle missing files in _cecb_open: Added a found flag to _cecb_open() to ensure that reaching the end of a directory without finding the target file returns EOS_PNNF (Path/File Not Found).
  • Remove directory open restriction: Removed the check returning EOS_SN when opening cassette paths with FAM_DIR.
  • Const correctness: Updated strendcasecmp parameters in util.h and libmiscutil.c to accept const char *.
  • Error handling: Added string lookup support for EOS_OM (Out of memory) and EOS_SN (Syntax error) in TSReportError(), and updated the EOS_PADROM definition in toolshed.h.

How to Test

  1. Run cecbbulkerase against a directory containing both WAV and non-WAV files to verify non-WAV files are skipped as intended.
  2. Attempt to open a non-existent file on a CECB tape/image and confirm EOS_PNNF is returned.
  3. Verify error messages print correctly for EOS_OM and EOS_SN.

…eports missing file errors during `_cecb_open`, updates function signatures to use `const` qualifiers, and adds missing error string mappings to `libtoolshed`.

* **Fix WAV extension validation in `cecbbulkerase`:** Inverted the check on `strendcasecmp` so that non-WAV files are correctly skipped rather than skipping valid WAV files.
* **Handle missing files in `_cecb_open`:** Added a `found` flag to `_cecb_open()` to ensure that reaching the end of a directory without finding the target file returns `EOS_PNNF` (*Path/File Not Found*).
* **Remove directory open restriction:** Removed the check returning `EOS_SN` when opening cassette paths with `FAM_DIR`.
* **Const correctness:** Updated `strendcasecmp` parameters in `util.h` and `libmiscutil.c` to accept `const char *`.
* **Error handling:** Added string lookup support for `EOS_OM` (*Out of memory*) and `EOS_SN` (*Syntax error*) in `TSReportError()`, and updated the `EOS_PADROM` definition in `toolshed.h`.

1. Run `cecbbulkerase` against a directory containing both WAV and non-WAV files to verify non-WAV files are skipped as intended.
2. Attempt to open a non-existent file on a CECB tape/image and confirm `EOS_PNNF` is returned.
3. Verify error messages print correctly for `EOS_OM` and `EOS_SN`.
@tlindner
tlindner merged commit 008ef81 into nitros9project:main Aug 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants