Skip to content

Fix libsys filename validation and add regression coverage - #93

Merged
tlindner merged 1 commit into
nitros9project:mainfrom
tlindner:feature/libsys-filename-validation
Oct 31, 2026
Merged

tlindner merged 1 commit into
nitros9project:mainfrom
tlindner:feature/libsys-filename-validation

Conversation

@tlindner

Copy link
Copy Markdown
Member

Correct four filename validation defects in libsys/prsnam.c:

  • Reverse the cassette BASIC isgraph check so ordinary graphical filenames are accepted and control characters are rejected.
  • Reject empty OS-9 filenames with EOS_BPNAM.
  • Reject multiple dots in Disk BASIC names to enforce the 8.3 structure.
  • Reject Disk BASIC names with an empty basename, including empty strings, .BAS, and a lone dot.

Preserve OS-9 support for names containing multiple dots, including A.B.C, while retaining Disk BASIC support for extensionless names and FILE.

Add an 11-test TinyTest suite in unittest/libsystest.c covering the regressions, valid names, control characters, and filename length limits. Register libsystest in the Unix test runner and its clean target.

Each defect was reproduced by a failing test before its fix. Validation: make -C build/unix passes all 76 tests; git diff --check is clean.

Correct four filename validation defects in libsys/prsnam.c:

- Reverse the cassette BASIC isgraph check so ordinary graphical filenames
  are accepted and control characters are rejected.
- Reject empty OS-9 filenames with EOS_BPNAM.
- Reject multiple dots in Disk BASIC names to enforce the 8.3 structure.
- Reject Disk BASIC names with an empty basename, including empty strings,
  .BAS, and a lone dot.

Preserve OS-9 support for names containing multiple dots, including A.B.C,
while retaining Disk BASIC support for extensionless names and FILE.

Add an 11-test TinyTest suite in unittest/libsystest.c covering the
regressions, valid names, control characters, and filename length limits.
Register libsystest in the Unix test runner and its clean target.

Each defect was reproduced by a failing test before its fix. Validation:
make -C build/unix passes all 76 tests; git diff --check is clean.
@tlindner
tlindner merged commit 8f1e7de into nitros9project:main Oct 31, 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