Repository navigation
This PR fixes logic bugs in cecb cassette tape handling, properly r… - #80
Merged
Merged
Conversation
…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`.
DrPitre
approved these changes
Aug 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes logic bugs in
cecbcassette tape handling, properly reports missing file errors during_cecb_open, updates function signatures to useconstqualifiers, and adds missing error string mappings tolibtoolshed.Changes Included
cecbbulkerase: Inverted the check onstrendcasecmpso that non-WAV files are correctly skipped rather than skipping valid WAV files._cecb_open: Added afoundflag to_cecb_open()to ensure that reaching the end of a directory without finding the target file returnsEOS_PNNF(Path/File Not Found).EOS_SNwhen opening cassette paths withFAM_DIR.strendcasecmpparameters inutil.handlibmiscutil.cto acceptconst char *.EOS_OM(Out of memory) andEOS_SN(Syntax error) inTSReportError(), and updated theEOS_PADROMdefinition intoolshed.h.How to Test
cecbbulkeraseagainst a directory containing both WAV and non-WAV files to verify non-WAV files are skipped as intended.EOS_PNNFis returned.EOS_OMandEOS_SN.