SIGN IN SIGN UP

gh-155974: Restore the window attributes when a curses write fails (GH-155975)

addstr(), addnstr(), insstr() and insnstr() set the window rendition to
the caller's attr, write, then restore the previous rendition.  Since
30dde1eeb3fa 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.
V
Vyron Vasileiadis committed
83531fd39f24f873671c38b981061afe1730613f
Parent: 9721f8f
Committed by GitHub <noreply@github.com> on 8/20/2026, 7:08:50 PM