This commit fixes two file descriptor leaks in the hist built-in. The bugfix for the first file descriptor leak was backported from ksh2020. See: https://github.com/att/ast/issues/872 https://github.com/att/ast/commit/73bd61b5 Reproducer: $ echo no $ hist -s no=yes The second file descriptor leak occurs after a substitution error in the hist built-in (this leak wasn't fixed in ksh2020). Reproducer: $ echo no $ ls /proc/$$/fd $ hist -s no=yes $ hist -s no=yes $ ls /proc/$$/fd src/cmd/ksh93/bltins/hist.c: - Close leftover file descriptors when an error occurs and after 'hist -s' runs a command. src/cmd/ksh93/tests/builtins.sh: - Add two regression tests for both of the file descriptor leaks. |
||
|---|---|---|
| .. | ||
| cmd | ||
| lib | ||
| Mamfile | ||