Fix output for no colour

This commit is contained in:
Roy Marples 2007-10-03 11:53:20 +00:00
parent 932a4576ce
commit ab38e54fed

View File

@ -30,7 +30,7 @@ static void print_level (char *level)
static void print_service (char *service) static void print_service (char *service)
{ {
char status[10]; char status[10];
int cols = printf (" %s\n", service); int cols = printf (" %s", service);
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;
@ -54,6 +54,9 @@ static void print_service (char *service)
color = ECOLOR_WARN; color = ECOLOR_WARN;
} else } else
snprintf (status, sizeof (status), " stopped "); snprintf (status, sizeof (status), " stopped ");
if (! rc_env_bool ("RC_NOCOLOR"))
printf ("\n");
ebracket (cols, color, status); ebracket (cols, color, status);
} }