Skip to content

Commit 4db745e

Browse files
committed
release: v2.10.2 -- heredocs on any descriptor
N<<EOF feeds fd N instead of stdin, N<<-EOF strips tabs and ends at EOF (lexer and heredoc pre-scan both read the dash from the operator), cmd 5<f <&5 checks the command's own resolved redirects before the shell's fd table, and a function definition takes redirects after its body (POSIX function_body), applied at every call and printed by declare -f. Golden categories heredoc_fd and func_def_redirect and two script tests pin all of it against bash 5.3.9; the prompt width unit links on clang.
1 parent 28ab440 commit 4db745e

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

‎RELEASE.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,35 @@ shows you how to drive the shell.
88

99
---
1010

11+
## v2.10.2 — *heredocs on any descriptor*
12+
13+
- **`N<<EOF` feeds fd N.** The body always went to stdin whatever N said,
14+
so `while read -r l <&3; do ...; done 3<<EOF` failed "3: Bad file
15+
descriptor" and `cat 3<<EOF </dev/null` printed the body. The redirect now
16+
carries its source fd, on a simple command, a compound, a function call, a
17+
pipeline member, a command substitution and `exec`.
18+
- **`N<<-EOF` strips tabs and ends at `EOF`.** The lexer read `3<<-` as
19+
`3<<` followed by the word `-EOF`, and the pre-scan that gathers a
20+
script's heredoc bodies agreed, so everything after the body vanished.
21+
Both now take the dash from the operator, whatever digits precede it.
22+
- **`cmd 5<file <&5` works for any fd.** The `<&N` check probed the shell's
23+
own fd table before the same command's earlier redirects were applied, so
24+
it failed for any fd the shell did not already have open (5 and up).
25+
It now asks the redirects already resolved for that command first; the
26+
last one naming the fd decides, so `5<f 5<&- <&5` is still refused.
27+
- **Redirects on a function definition.** `f() { ...; } 2>/dev/null` was a
28+
syntax error. POSIX's `function_body: compound_command [redirect_list]`
29+
is parsed now: the redirects belong to the body and apply at every call,
30+
heredocs included (re-expanded per call, even when the body and the
31+
heredoc sit on the definition's own line), and `declare -f` prints them.
32+
- **Tests:** golden categories `heredoc_fd` (34 cases) and
33+
`func_def_redirect` (26), scripts `50_heredoc_fd.sh` and
34+
`51_func_def_redirect.sh`, all diffed against the pinned bash 5.3.9.
35+
tests/prompt_width_test.c links on clang too (a weak `ft_eprintf` stub for
36+
the inline error helpers clang emits at -O0).
37+
38+
---
39+
1140
## v2.10.1 — *the whole VM under the logger*
1241

1342
- **born2root is hellish throughout, and an exec log says so.** Launched

‎incs/version.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
/* The single source of truth for the running shell's version. Bumped in step
1717
with the git tag / GitHub release / npm package / docker image. */
18-
# define HELLISH_VERSION "2.10.1"
18+
# define HELLISH_VERSION "2.10.2"
1919

2020
/* Where releases live; used by the `update` builtin and the daily check. */
2121
# define HELLISH_REPO "Univers42/hellish"

‎npm/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hellish-shell",
3-
"version": "2.10.1",
3+
"version": "2.10.2",
44
"description": "hellish — a fast, POSIX-compliant shell, with horns",
55
"bin": {
66
"hellish": "bin/hellish.js"

0 commit comments

Comments
 (0)