Just check that ecolor returns a string > 0
This commit is contained in:
parent
acf425e822
commit
b1569127b4
@ -58,6 +58,7 @@ static void print_service (char *service)
|
|||||||
{
|
{
|
||||||
char status[10];
|
char status[10];
|
||||||
int cols = printf (" %s", service);
|
int cols = printf (" %s", service);
|
||||||
|
const char *c = ecolor (ECOLOR_GOOD);
|
||||||
rc_service_state_t state = rc_service_state (service);
|
rc_service_state_t state = rc_service_state (service);
|
||||||
einfo_color_t color = ECOLOR_BAD;
|
einfo_color_t color = ECOLOR_BAD;
|
||||||
|
|
||||||
@ -83,8 +84,7 @@ static void print_service (char *service)
|
|||||||
snprintf (status, sizeof (status), " stopped ");
|
snprintf (status, sizeof (status), " stopped ");
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if ((rc_yesno (getenv ("EINFO_COLOR")) || errno == ENOENT) &&
|
if (c && *c && isatty (fileno (stdout)))
|
||||||
isatty (fileno (stdout)))
|
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
ebracket (cols, color, status);
|
ebracket (cols, color, status);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user