Commit 61b217a
gh-152503: Fix garbage text from curses wide-character cell reads
window.in_wch(), window.in_wchstr() and window.getbkgrnd() read a cell
into an uninitialized cchar_t, relying on the curses library to leave the
text NUL-terminated -- which ncurses does but X/Open does not require, so
some libraries (such as NetBSD curses) returned uninitialized bytes as
wide characters. Zero-initialize the cell buffers before the read and
default the getcchar() output to an empty string.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 65585ca commit 61b217a
2 files changed
Lines changed: 15 additions & 3 deletions
File tree
- Misc/NEWS.d/next/Library
- Modules
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
768 | 771 | | |
769 | 772 | | |
770 | 773 | | |
| |||
3049 | 3052 | | |
3050 | 3053 | | |
3051 | 3054 | | |
3052 | | - | |
| 3055 | + | |
| 3056 | + | |
3053 | 3057 | | |
3054 | 3058 | | |
3055 | 3059 | | |
| |||
3096 | 3100 | | |
3097 | 3101 | | |
3098 | 3102 | | |
3099 | | - | |
| 3103 | + | |
| 3104 | + | |
3100 | 3105 | | |
3101 | 3106 | | |
3102 | 3107 | | |
| |||
3812 | 3817 | | |
3813 | 3818 | | |
3814 | 3819 | | |
3815 | | - | |
| 3820 | + | |
| 3821 | + | |
| 3822 | + | |
| 3823 | + | |
3816 | 3824 | | |
3817 | 3825 | | |
3818 | 3826 | | |
| |||
0 commit comments