Date:        Sun, 1 Jun 2025 17:36:11 -0400
    From:        Jan Schaumann <jscha...@netmeister.org>
    Message-ID:  <adzhy57ssgw1o...@netmeister.org>

  | Is this something that should be fixed?

Any time I see a question like that, about our /bin/ksh
my default answer is just "yes" without even investigating.

Our ksh is such an unmaintained swamp full of so many bugs
it is hard to imagine anything worse ... I'd just remove it,
except it seems that some people (despite all its problems)
like to use it.

Try running the sh ATF tests against it (ignore whatever happens
with the dotcmd tests, they haven't been updated to be able to
test anything except /bin/sh, so that's what they always test):

        TEST_SH=/bin/ksh atf-run | atf-report

(in tests/bin/sh) and be amazed at how much is wrong...

And this issue with -p most probably isn't even tested.

Aside from the dotcmd tests (which will pass, but they're NetBSD sh
specific, and would probably fail if they were testing ksh, without that
implying anything at all about ksh) also ignore any tests which are skipped,
some of the tests are for known extensions, and when the shell being tested
doesn't support that, the test just skips.

Those should all be treated as OK.   But most (if perhaps not all) of the
tests that fail are bugs - but each would need investigating, we may still
have some tests which test /bin/sh's behaviour in cases specified to be
unspecified (if that makes any sense) and so which wouldn't actually represent
bugs, just differences.

Also ignore (in HEAD's version of the tests, maybe -10's as well) the
t_input nul_elimination test, that's marked as expected_fail because of
a change in /bin/sh -- that it fails to fail in ksh means nothing.
That test needs expensive work which I haven't gotten around to yet
(\0's in sh input leads to unspecified behaviour, so a portable test
for it is difficult in any case).

Any Bourne compat shell can be tested that way, for something like
zsh, use

        TEST_SH='zsh --emulate sh' atf-run...

(testing zsh in its native mode is pointless, it doesn't pretend to be
Bourne sh compat that way).  Options can be passed to other shells, if
needed, in a similar way.

kre


Reply via email to