lualoader: don't botch disabling of color

When colors are disabled, color.escape{fg,bg} would return the passed in
color rather than the proper ANSI sequence for the color.
color.escape{fg,bg} would be wrong.

Instead return '', as the associated reset* functions will also return ''.
This should get rid of the funky '2' and '4' in the kernel selector if
you're booting serial.

Reported by:	npn
This commit is contained in:
Kyle Evans 2019-10-21 20:09:43 +00:00
parent dfe76e95ae
commit a6cf4be042
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=353872
2 changed files with 4 additions and 4 deletions

View File

@ -58,7 +58,7 @@ color.disabled = not color.isEnabled()
function color.escapefg(color_value)
if color.disabled then
return color_value
return ''
end
return core.KEYSTR_CSI .. "3" .. color_value .. "m"
end
@ -72,7 +72,7 @@ end
function color.escapebg(color_value)
if color.disabled then
return color_value
return ''
end
return core.KEYSTR_CSI .. "4" .. color_value .. "m"
end

View File

@ -47,14 +47,14 @@ end
function screen.setforeground(color_value)
if color.disabled then
return color_value
return
end
printc(color.escapefg(color_value))
end
function screen.setbackground(color_value)
if color.disabled then
return color_value
return
end
printc(color.escapebg(color_value))
end