Commit b589445
committed
gh-155974: Restore the window attributes when a curses write fails
addstr(), addnstr(), insstr() and insnstr() set the window rendition to
the caller's attr, write, then restore the previous rendition. Since
30dde1e the restore sits below an early return taken when the write
fails, so a failed write leaves the caller's attr on the window and
drops whatever the application had set with attrset().
Restore the rendition first and report the write error afterwards. A
wattrset() failure is still reported when the write itself succeeded.1 parent fa0ec86 commit b589445
3 files changed
Lines changed: 43 additions & 28 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
898 | 913 | | |
899 | 914 | | |
900 | 915 | | |
| |||
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 | |
|---|---|---|---|
| |||
2262 | 2262 | | |
2263 | 2263 | | |
2264 | 2264 | | |
2265 | | - | |
2266 | | - | |
2267 | | - | |
2268 | | - | |
2269 | 2265 | | |
2270 | | - | |
2271 | | - | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
2272 | 2271 | | |
2273 | | - | |
| 2272 | + | |
2274 | 2273 | | |
2275 | 2274 | | |
2276 | 2275 | | |
| |||
2373 | 2372 | | |
2374 | 2373 | | |
2375 | 2374 | | |
2376 | | - | |
2377 | | - | |
2378 | | - | |
2379 | | - | |
2380 | 2375 | | |
2381 | | - | |
2382 | | - | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
2383 | 2381 | | |
2384 | | - | |
| 2382 | + | |
2385 | 2383 | | |
2386 | 2384 | | |
2387 | 2385 | | |
| |||
4094 | 4092 | | |
4095 | 4093 | | |
4096 | 4094 | | |
4097 | | - | |
4098 | | - | |
4099 | | - | |
4100 | | - | |
4101 | 4095 | | |
4102 | | - | |
4103 | | - | |
| 4096 | + | |
| 4097 | + | |
| 4098 | + | |
| 4099 | + | |
| 4100 | + | |
4104 | 4101 | | |
4105 | | - | |
| 4102 | + | |
4106 | 4103 | | |
4107 | 4104 | | |
4108 | 4105 | | |
| |||
4206 | 4203 | | |
4207 | 4204 | | |
4208 | 4205 | | |
4209 | | - | |
4210 | | - | |
4211 | | - | |
4212 | | - | |
4213 | 4206 | | |
4214 | | - | |
4215 | | - | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
| 4210 | + | |
| 4211 | + | |
4216 | 4212 | | |
4217 | | - | |
| 4213 | + | |
4218 | 4214 | | |
4219 | 4215 | | |
4220 | 4216 | | |
| |||
0 commit comments