gh-156951: Do not truncate the color pair in curses.slk_color() - #156952
Open
fedonman wants to merge 1 commit into
Open
gh-156951: Do not truncate the color pair in curses.slk_color()#156952fedonman wants to merge 1 commit into
fedonman wants to merge 1 commit into
Conversation
slk_color() cast its color pair to a short before calling ncurses, while the pair converter accepts pairs up to INT_MAX on a build with extended color support. Pairs of 32768 and above were rejected although the rest of the module accepts them, and a pair whose low 16 bits named a valid pair was silently applied in place of the one that was asked for. Call extended_slk_color() under the module's existing _NCURSES_EXTENDED_COLOR_FUNCS guard, as slk_attr_set() and window.color_set() already do, and keep the legacy call for builds without it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
slk_color()cast its color pair to ashort, so pairs of 32768 and above were rejected and a pair whose low 16 bits named a valid pair was silently applied in its place. It now callsextended_slk_color()under the module's existing_NCURSES_EXTENDED_COLOR_FUNCSguard, asslk_attr_set()andwindow.color_set()already do.No
Misc/NEWS.dentry:slk_color()isversionadded:: nextand has not been in a release.curses.slk_color()truncates its color pair argument to a short #156951