From cfc76650f29c9316c90392f558af66923aecb682 Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Mon, 23 Aug 2021 18:48:23 -0400 Subject: ls(1)-Allow-LSCOLORS-to-specify-an-underline.patch: Compare using operators --- ls-1-Allow-LSCOLORS-to-specify-an-underline.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ls-1-Allow-LSCOLORS-to-specify-an-underline.patch') diff --git a/ls-1-Allow-LSCOLORS-to-specify-an-underline.patch b/ls-1-Allow-LSCOLORS-to-specify-an-underline.patch index 095d6f3..e072094 100644 --- a/ls-1-Allow-LSCOLORS-to-specify-an-underline.patch +++ b/ls-1-Allow-LSCOLORS-to-specify-an-underline.patch @@ -1,4 +1,4 @@ -From f873a0a04c981fbcc7879bcefe355fbbfd1a8adb Mon Sep 17 00:00:00 2001 +From 62bedad5fc7607ffbf76ab1f45b0aebd4b424289 Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Fri, 28 May 2021 17:56:48 -0400 Subject: [PATCH] ls(1): Allow LSCOLORS to specify an underline @@ -72,10 +72,10 @@ index 8510ca609cd..ef412dd2927 100644 .Pp Note that the above are standard diff --git a/bin/ls/ls.c b/bin/ls/ls.c -index 338b3d1d2a2..67cb91fdcde 100644 +index 92575711251..8a30dd326b4 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c -@@ -161,6 +161,7 @@ char *ansi_fgcol; /* ANSI sequence to set foreground colour */ +@@ -159,6 +159,7 @@ char *ansi_fgcol; /* ANSI sequence to set foreground colour */ char *ansi_coloff; /* ANSI sequence to reset colours */ char *attrs_off; /* ANSI sequence to turn off attributes */ char *enter_bold; /* ANSI sequence to set color to bold mode */ @@ -92,7 +92,7 @@ index 338b3d1d2a2..67cb91fdcde 100644 /* To switch colours off use 'op' if * available, otherwise use 'oc', or diff --git a/bin/ls/print.c b/bin/ls/print.c -index 9a537418f7b..da92668d5c5 100644 +index 9a537418f7b..d07b83ed830 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -107,6 +107,7 @@ static const char *defcolors = "exfxcxdxbxegedabagacad"; @@ -135,12 +135,12 @@ index 9a537418f7b..da92668d5c5 100644 colors[i].num[j] = c[j] - 'A'; - colors[i].bold = 1; - } else if (tolower((unsigned char)c[j]) == 'x') -+ if (j) ++ if (j == 1) + colors[i].underline = 1; + else + colors[i].bold = 1; + } else if (tolower((unsigned char)c[j]) == 'x') { -+ if (j && c[j] == 'X') ++ if (j == 1 && c[j] == 'X') + colors[i].underline = 1; colors[i].num[j] = -1; + } @@ -148,5 +148,5 @@ index 9a537418f7b..da92668d5c5 100644 warnx("invalid character '%c' in LSCOLORS" " env var", c[j]); -- -2.31.1 +2.32.0 -- cgit v1.2.3-56-ge451