Skip to content

os9: refuse a space in an OS-9 file name - #108

Merged
tlindner merged 1 commit into
nitros9project:mainfrom
markrvmurray:os9-no-space-names
Nov 8, 2026
Merged

tlindner merged 1 commit into
nitros9project:mainfrom
markrvmurray:os9-no-space-names

Conversation

@markrvmurray

Copy link
Copy Markdown
Contributor

NitrOS-9 ends a file name at a space: F$PrsNam stops there, and the shell splits its arguments on spaces with no quoting to get round it. So a file whose name holds a space can be listed, but it cannot be named on an OS-9 command line to open, delete or rename.

os9 copy and os9 rename could still create such names, because _os9_prsnam accepted a space. This drops the space from the characters it accepts.

  • os9 copy "a b" disk.dsk,"a b" now fails with error 215 (badly formed pathname).
  • A file that already has a space keeps working from the host: os9 rename disk.dsk,"a b" ab still renames it to a legal name, as only the new name is checked.
  • unittest/libsystest.c gains a test for a space at the start, middle and end of a name.

Tested: make and make -C build/unix/unittest testall (all suites pass) on macOS, plus the copy and rename cases above by hand.

NitrOS-9 ends a name at a space, so a file whose name holds one cannot
be named on its command line, and the shell has no quoting to get round
that. The os9 tool still let copy and rename create such names. Drop the
space from the characters _os9_prsnam accepts, and test it. A file that
already has a space can still be renamed to a legal name.
@tlindner
tlindner merged commit 0022f9b into nitros9project:main Nov 8, 2026
8 checks passed
@markrvmurray
markrvmurray deleted the os9-no-space-names branch November 9, 2026 22:16
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.

3 participants