Skip to content

Commit

Permalink
Avoid crash with read -e
Browse files Browse the repository at this point in the history
The promptset_for_read function did not initialize the predict field of
the promptset_T structure, which caused a crash when the read built-in
reads input with line-editing enabled.

Fixes #114
  • Loading branch information
magicant committed Feb 11, 2025
1 parent 245d7fd commit ee6ab5e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
- The `trap` built-in now also reports signals that are ignored
because the program that invoked the shell has set the signal
to be ignored.
- Fixed a possible crash when the `read` built-in reads input
with line-editing enabled.

## Yash 2.58.1 (2025-02-04)

Expand Down
2 changes: 2 additions & 0 deletions NEWS.ja
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
も含めて全てのトラップを表示する。
- `trap` 組込みはシェルが起動された時点で最初から無視されていた
シグナルも表示するようになった
- `read` 組込みが行編集を使用して入力を読み込む際にクラッシュすること
があったのを修正

## Yash 2.58.1 (2025-02-04)

Expand Down
1 change: 1 addition & 0 deletions variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -2883,6 +2883,7 @@ struct promptset_T promptset_for_read(
ps.main = escape(ro->prompt != NULL ? ro->prompt : L"", L"\\");
ps.right = xwcsdup(L"");
ps.styler = xwcsdup(L"");
ps.predict = xwcsdup(L"");
return ps;
}

Expand Down

0 comments on commit ee6ab5e

Please sign in to comment.