mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
color_tools: protect short2rgb against values with leading zeroes
This commit is contained in:
parent
4f48345fa2
commit
f24c7afa69
2 changed files with 26 additions and 0 deletions
23
news/fix-ansi-colors.rst
Normal file
23
news/fix-ansi-colors.rst
Normal file
|
@ -0,0 +1,23 @@
|
|||
**Added:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Changed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Removed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* Fixed crash while converting ANSI color codes with leading zeroes
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
|
@ -385,6 +385,9 @@ def RGB_TO_SHORT():
|
|||
|
||||
|
||||
def short2rgb(short):
|
||||
short = short.lstrip("0")
|
||||
if short == "":
|
||||
short = "0"
|
||||
return SHORT_TO_RGB[short]
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue