Skip to content

Commit

Permalink
util (ble/builtin/trap): fix a failure of setting the trap-handler ex…
Browse files Browse the repository at this point in the history
…it status
  • Loading branch information
akinomyoga committed Feb 13, 2022
1 parent f6af802 commit c513ed4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/ChangeLog.md
Expand Up @@ -311,6 +311,7 @@
- global (`ble/builtin/*`): work around `set -eu` in NixOS initialization (reported by SuperSandro2000) `#D1743` 001c595
- util, edit, contrib: add support for `bash-preexec` (motivated by SuperSandro2000) `#D1744` e85f52c
- util (`ble/builtin/trap`): fix resetting `$?` and `$_` (reported by SuperSandro2000) `#D1757` dfc6221
- util (`ble/builtin/trap`): fix a failure of setting the trap-handler exit status (reported by SuperSandro2000) `#D1771` 0000000
- main: check `IN_NIX_SHELL` to inactivate ble.sh in nix-shell (suggested by SuperSandro2000) `#D1747` b4bd955
- main: force prompt-attach inside the nix-shell `rc` `#D1766` 0000000
- canvas: test the terminal for the sequence of clearing `DECSTBM` `#D1748` 4b1601d
Expand Down
10 changes: 10 additions & 0 deletions note.txt
Expand Up @@ -6089,6 +6089,16 @@ bash_tips

2022-02-13

* util: EXIT trap を設定していると実際に exit する時に return に空文字列が渡される [#D1771]
https://github.com/akinomyoga/ble.sh/issues/175

これは明らかに最近書き直した trap handler 周りのの処理の問題である。と思っ
たが return を呼び出している箇所では特に空文字列が渡されそうなコードは見え
ない。再現はできているのでどうなっているか確認する事にする。

→分かった ble/util/setexit に渡す引数が空になっている。と思ったら単に typo
だった。というよりは変数名の変更漏れ。

* [棄却] complete: ls ~/.c{onfig,1}/[TAB] としても候補が生成されない [#D1770]

うーん。これは今迄ちゃんと候補が生成できるだろうと思っていたがそうでもない
Expand Down
2 changes: 1 addition & 1 deletion src/util.sh
Expand Up @@ -2117,7 +2117,7 @@ function ble/builtin/trap/invoke {
case $_ble_trap_done in
(done)
_ble_builtin_trap_lastarg=$_ble_trap_lastarg
_ble_builtin_trap_postproc="ble/util/setexit $_ble_trap_lastext" ;;
_ble_builtin_trap_postproc="ble/util/setexit $_ble_trap_lastexit" ;;
(break | continue)
_ble_builtin_trap_lastarg=$_ble_trap_lastarg
if ble/string#match "$_ble_trap_lastarg" '^-?[0-9]+$'; then
Expand Down

0 comments on commit c513ed4

Please sign in to comment.