<feed xmlns='http://www.w3.org/2005/Atom'>
<title>zash.git/tests, branch main</title>
<subtitle>Fast Almquist-family POSIX shell for z/OS UNIX with bundled libedit</subtitle>
<id>https://git.abendless.com/zash.git/atom?h=main</id>
<link rel='self' href='https://git.abendless.com/zash.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/'/>
<updated>2026-11-29T18:37:49Z</updated>
<entry>
<title>Remove host-specific references, add CI badge, and prepare 0.5.0-beta zopen buildenv</title>
<updated>2026-11-29T18:37:49Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-29T18:37:49Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=0014d37a6e3113dabc003e84cb2b0ba6bcb94b8c'/>
<id>urn:sha1:0014d37a6e3113dabc003e84cb2b0ba6bcb94b8c</id>
<content type='text'>
- Remove internal z/OS test-host name from notes/review-2026-11-27.md,
  web/layouts/home.html, and tests/zos/zosvars.{sh,exp} (making zosvars
  portable to any z/OS LPAR by comparing against live ZOS_SYSNAME).
- Add GitHub Actions CI status badge to README.md.
- Bump buildenv version to 0.5.0 with ZOPEN_STABLE_URL, ZOPEN_STABLE_TAG
  (v0.5.0-beta), ZOPEN_DEV_URL, and explicit empty ZOPEN_RUNTIME_DEPS.
</content>
</entry>
<entry>
<title>Fix zopen packaging checks, update i-dscomplete.exp, and add GitHub Actions CI</title>
<updated>2026-11-29T16:20:40Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-29T16:20:40Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=c395bd53d22de9fcda6bfec25596223845e83a22'/>
<id>urn:sha1:c395bd53d22de9fcda6bfec25596223845e83a22</id>
<content type='text'>
- buildenv: declare coreutils, diffutils, and gzip in ZOPEN_DEV_DEPS and
  ZOPEN_STABLE_DEPS (build/check deps only; no runtime deps added) so
  tests/run.sh and tests/zos/tagging.sh have GNU tools and gzip under
  zopen build's minimal check environment.
- tests/run.sh: unset _TAG_REDIR_IN, _TAG_REDIR_OUT, and _TAG_REDIR_ERR
  alongside _BPX_SHAREAS/_BPX_SPAWN_SCRIPT so zopen's check_clang env
  does not alter the tagging test baseline.
- tests/linux/i-dscomplete.exp: update expected listing for CSI_MAX_CALLS=3
  (changed from 2 to 3 in b3879f5 without regenerating .exp).
- .github/workflows/ci.yml: add Linux CI workflow (Clang 19+, make,
  make zos-lint, make check, make asan, staged make install).
</content>
</entry>
<entry>
<title>Add regression tests for audit fixes and clear clang-tidy findings</title>
<updated>2026-11-29T04:02:44Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-29T04:02:44Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=3ded9a80de9a487bcae31c695740d82d1a0e13fd'/>
<id>urn:sha1:3ded9a80de9a487bcae31c695740d82d1a0e13fd</id>
<content type='text'>
- Add tests/zash/audit-fixes.{sh,exp} covering uppercase bases, closed-fd
  duplication, [[ ...  ]] and nested here-docs, quoted braces,
  'for x; in', environment deduplication, PS4 expansion, pure subshell
  write errors, pipeline unwind loop_depth, 'set +o', POSIX 1-4 arg test
  rules, print -u bounds, whence -p, printf overflow and bare %b NULs,
  time/select keywords, '--' handling, unalias -- -a, kill --, and read -t 0.
- Clear remaining clang-tidy warnings on changed lines in edit_builtin.c,
  sys_posix.c, test.c, and var.c.

Verified on Linux (./zash and ./zash-asan); z/OS CBT verification next.
</content>
</entry>
<entry>
<title>tests: cover the review fixes that landed without one</title>
<updated>2026-11-28T22:34:52Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-28T22:34:52Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=648125a5ef1a98519c5d2cd66c4f015bcb8b5b1f'/>
<id>urn:sha1:648125a5ef1a98519c5d2cd66c4f015bcb8b5b1f</id>
<content type='text'>
The 2026-11-28 review merge (#46) and the in-process `( cd dir )` merge
(#31) left four changes with no test of their own. Three of the eighteen
commits cannot have one, see below.

- tests/posix/glob-edge.sh: `deep/*` where `deep` holds a file, a
  subdirectory, a symlink and a dangling symlink. This is the path the
  glob change takes when the last component has no literal tail left:
  it adds what readdir() named without an lstat(), so a directory and a
  broken link must still appear. Replacing `sb_cstr(&amp;g-&gt;path)` with the
  unterminated buffer in that call makes this test fail.
- tests/posix/charset.sh: a reversed range `[z-a]` matches nothing,
  which is what dash and bash do; the ASCII fast path compares bytes
  where the EBCDIC path looks up a table, so the two must agree on the
  edge.
- tests/posix/printf-ext.sh: a 5000-character `%s`. The bare `%s` fast
  path writes the argument straight to the output instead of through
  the format buffer, so length is now the output's business.
- tests/zash/heredoc-tmpdir.sh: a TMPDIR longer than PATH_MAX still
  produces the here-document, through the pipe fallback.
- .exp files regenerated with dash (posix) and ./zash (zash), then
  reviewed: only the added lines differ.

The three commits with no test:

- 270ac66 `signal()` to `sigaction()` for SIG_DFL: the disposition set is
  the same, so no test can tell the two apart.
- 06e1dd5 the arena size guard: reaching it needs a SIZE_MAX/2
  allocation.
- de0d26a the TMPDIR length check itself: a truncated temp name has no
  `XXXXXX` left, so mkstemp() already failed and the pipe fallback
  already ran. heredoc-tmpdir.sh pins that fallback, not the check.

Verified on Linux (7.3.4-300.fc45.x86_64, 2026-11-28): make check 128
passed, 1 skipped, the known linux/i-dscomplete failure; make asan the
same with no sanitizer report; the new posix tests pass against dash too.
</content>
</entry>
<entry>
<title>Merge main into perf/cd-inproc: one in-process `( cd dir )`, not two</title>
<updated>2026-11-28T20:34:40Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-28T20:34:40Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=78d73092a29cca7e3ce4ef6b5e2c6cd244f40202'/>
<id>urn:sha1:78d73092a29cca7e3ce4ef6b5e2c6cd244f40202</id>
<content type='text'>
main gained an in-process `( cd dir )` of its own with the 2026-11-28
review merge (the uncommitted working tree the review was written
against, committed as cb1688f), so this branch and main both replaced
the fork for the same command, in two places.

That copy has a defect this branch guards against: with

    readonly PWD; ( cd / ); echo after

the readonly assignment raises out of the saved-cwd block and kills the
whole shell - no `after` - where dash and bash both print it (dash rc=2,
bash rc=1). `subshell_in_process()` here refuses to run the `cd`
in-process unless PWD and OLDPWD are plain, and `builtin_cd_isolated()`
holds its own exception handler, so the fork still happens in that case.

Resolution: keep this branch's implementation and drop main's ad-hoc
branch in eval_subshell() together with the curdir_invalidate() helper
added for it, which had no other caller. The tests main brought with it
(tests/zash/subshell-cd.sh, tests/proc/subshell-pure.sh) still pass.

Verified on Linux (7.3.4-300.fc45.x86_64, 2026-11-28): make check 127
passed / 1 skipped / the known linux/i-dscomplete failure, make asan and
make valgrind the same, make mvs-asan 127 passed, make zos-lint clean,
the readonly-PWD case now matches dash. Not re-run on cbt.
</content>
</entry>
<entry>
<title>fix(edit): vi search reads its pattern into a buffer of its own</title>
<updated>2026-11-28T06:39:28Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-28T06:39:28Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=95bf87d4ed037e6d6786cc395d94dbe44ee88e32'/>
<id>urn:sha1:95bf87d4ed037e6d6786cc395d94dbe44ee88e32</id>
<content type='text'>
`/` wrote the new pattern over the old one in ed.search and only wrote a
terminator when something had been typed.  Type `ban` over `apple`, delete
the three letters, press Enter: the buffer still held "banle", so the
"empty pattern repeats the previous search" case searched a mix of the two
and found nothing (the terminal just beeped).

vi_read_pattern() collects the pattern in a local array and copies it into
ed.search only when it is non-empty; an empty pattern now really does leave
the previous one alone.

Test: tests/linux/i-vi.sh searches for apple, then types `ban` + three
backspaces + Enter, and expects `echo apple` back.  Without the change the
line stays empty.

Verified on Linux with make check.
</content>
</entry>
<entry>
<title>fix(edit): quote the temporary file name for the editor</title>
<updated>2026-11-28T06:37:39Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-28T06:37:39Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=d538cc8ce9c32c932e12134b7bd59a88e88d748c'/>
<id>urn:sha1:d538cc8ce9c32c932e12134b7bd59a88e88d748c</id>
<content type='text'>
`v` and `fc -e` handed the editor "%s %s" of the editor and the mkstemp
file name, unquoted: with a TMPDIR holding a space or a `$` the editor saw
a path cut at the space, wrote nothing, and `fc` ran the original commands
again.  The name now goes through out_quote() into an OUT_MEM buffer, so
the shell reads it back as one word; `sprintf` is gone.

Both commands also left the file behind when the editor command raised an
exception (a syntax error in $EDITOR, for one), because the raise jumps
past unlink().  They now catch it, unlink, and re-raise, the same way the
builtin wrapper in exec.c does.

fc_edit() also ignored a write error on the temporary file and went on to
run the editor; it now reports it and removes the file.

Test: tests/linux/i-fc-tmpdir.sh runs fc and `v` with TMPDIR="tmp dir$x"
through ptydrive, including a raising editor command, and then checks the
directory is empty.  Without the change the editor is handed the broken
path and no file appears.

Verified on Linux with make check and the test under ASan+UBSan.
</content>
</entry>
<entry>
<title>fix(expand): trim each positional parameter for ${@#pat}</title>
<updated>2026-11-28T06:33:12Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-28T06:33:12Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=662f3b37dcfad0fd2f193762464c1b9701c96db9'/>
<id>urn:sha1:662f3b37dcfad0fd2f193762464c1b9701c96db9</id>
<content type='text'>
`"${@#ab}"` with `set -- abc abd` joined the parameters first
("abc abd"), trimmed the join, and emitted that as a single field
("c abd").  ksh93 and bash trim each parameter and then apply the "$@"
rules: two fields, "c" and "d".

expand_all_params() takes the pattern and the operator and trims every
parameter before emitting, so `"${@#pat}"` still gives one field each,
`"${*#pat}"` one field joined by IFS, and unquoted both split as before.
join_params_trimmed() is the join path, and trim() gets a forward
declaration because it sits further down the file.

Test: tests/zash/trim-all.sh, twelve lines covering all four operators,
@ and *, quoted and unquoted, empty parameters and a non-blank IFS.  The
expected output is ksh93's and bash's, which agree line for line.

Verified on Linux with make check.
</content>
</entry>
<entry>
<title>fix(ulimit): refuse a limit that does not fit rlim_t</title>
<updated>2026-11-28T06:31:36Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-28T06:31:36Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=447151dabfbad0a41c8f049938042cd886d9f451'/>
<id>urn:sha1:447151dabfbad0a41c8f049938042cd886d9f451</id>
<content type='text'>
`ulimit -s 18014398509481984` (2^54 kbytes = 2^64 bytes) multiplied a
64-bit value by 1024 and wrapped to 0: the command succeeded and set the
stack limit to zero.  It is now "limit out of range" and status 1, and so
is a value that would come out exactly RLIM_INFINITY without the user
writing "unlimited".

The `ulimit -a` label was copied into a 64-byte buffer for no reason;
"% -20s" gets the name straight from the table.  And if a build has no
RLIMIT_FSIZE entry there is no default resource at all, so say that
instead of dereferencing a null pointer.

Test: tests/zash/ulimit.sh, in a subshell so a broken build cannot take
the test shell down with it.  Verified on Linux: before the change the
command exits 0 and `ulimit -s` reports 0; after it, the warning and
status 1.
</content>
</entry>
<entry>
<title>fix(edit): vi `y` keeps the line and never pastes the old kill</title>
<updated>2026-11-28T06:30:30Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-28T06:30:30Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=56bd0e6c2ab87ab140cef35882cff52153f36b7c'/>
<id>urn:sha1:56bd0e6c2ab87ab140cef35882cff52153f36b7c</id>
<content type='text'>
`y0` with the cursor at column 0 yanks an empty range, and the old code
then inserted the kill buffer at the cursor: with nothing killed yet that
was memcpy(dst, nullptr, 0), which UBSan rejects at src/edit_builtin.c:375;
with an earlier `cw` behind it, the old kill text was pasted into the
line (vi `y` changes nothing on the line).

The `y` case now copies the range into the kill buffer with kill_set() -
the same block remove_range() used - and puts the cursor at the start of
the range, which is where vi leaves it.  insert() also returns early for
an empty string, so a later caller cannot repeat the null memcpy.

Test: tests/linux/i-vi.sh yanks an empty range after a `cw`, so the kill
buffer holds text that must not appear.  Before the change UBSan reports
"null pointer passed as argument 2" and the line comes out as
"oneecho yank"; after it, the line is "echo yank".

Verified on Linux with make check and the same pty session under
ASan+UBSan.
</content>
</entry>
</feed>
