diff options
author | Roy Marples <roy@marples.name> | 2007-12-07 14:32:28 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-12-07 14:32:28 +0000 |
commit | b1569127b40aa89cb8a2693cad868b1e187a2dee (patch) | |
tree | 9b49ce1a692a3a5e55da288e9b639963e5ec990d | |
parent | acf425e82212179a27686ebc6a42e6021ea71e5c (diff) |
Just check that ecolor returns a string > 0
-rw-r--r-- | src/rc-status.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rc-status.c b/src/rc-status.c index 50d05edc..dc515af7 100644 --- a/src/rc-status.c +++ b/src/rc-status.c @@ -58,6 +58,7 @@ static void print_service (char *service) { char status[10]; int cols = printf (" %s", service); + const char *c = ecolor (ECOLOR_GOOD); rc_service_state_t state = rc_service_state (service); einfo_color_t color = ECOLOR_BAD; @@ -83,8 +84,7 @@ static void print_service (char *service) snprintf (status, sizeof (status), " stopped "); errno = 0; - if ((rc_yesno (getenv ("EINFO_COLOR")) || errno == ENOENT) && - isatty (fileno (stdout))) + if (c && *c && isatty (fileno (stdout))) printf ("\n"); ebracket (cols, color, status); } |