Fix program crashing when LS_COLORS environment variable doesn't exist.

Now using the default colors, but they're not quite right yet...
This commit is contained in:
Andrew Hamilton 2015-12-30 00:52:54 +00:00
parent da280ea9b2
commit 4dd8915312

View file

@ -586,6 +586,9 @@ def _convert_lscolor_code_to_charstyle(lscolor_code):
if len(parts) == 1:
is_bold = parts[0] == "1"
fg_color = None
elif len(parts) == 2:
is_bold = False
fg_color = int(parts[1])
else:
is_bold = len(parts) == 4 and parts[3] == "1"
fg_color = int(parts[2])