X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fcoloredstderr.c;h=2970a1eb95170558dd2cbbb8c647f4766a2b3c58;hb=39d313d1d474dbe025270b9555a5dfb03286c8c9;hp=4664f0d1a8d0efb033fb11bf28814fc4a730d12c;hpb=2241f5278e786c429b8d657c807ead792b4b5b36;p=coloredstderr%2Fcoloredstderr.git diff --git a/src/coloredstderr.c b/src/coloredstderr.c index 4664f0d..2970a1e 100644 --- a/src/coloredstderr.c +++ b/src/coloredstderr.c @@ -193,7 +193,7 @@ static void handle_fd_pre(int fd) { int saved_errno = errno; - if (unlikely(!pre_string || !post_string)) { + if (unlikely(!pre_string)) { init_pre_post_string(); } @@ -222,7 +222,7 @@ static void handle_file_pre(FILE *stream) { int saved_errno = errno; - if (unlikely(!pre_string || !post_string)) { + if (unlikely(!pre_string)) { init_pre_post_string(); } @@ -371,7 +371,7 @@ static void error_vararg(int status, int errnum, if (error_one_per_line && filename != NULL && linenum != 0 && filename == last_filename && linenum == last_linenum) { - return; + goto out; } last_filename = filename; last_linenum = linenum; @@ -404,6 +404,7 @@ static void error_vararg(int status, int errnum, fprintf(stderr, "\n"); +out: if (status != 0) { exit(status); }