]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/blobdiff - src/coloredstderr.c
Fix error_at_line() not always exiting if status != 0.
[coloredstderr/coloredstderr.git] / src / coloredstderr.c
index 4664f0d1a8d0efb033fb11bf28814fc4a730d12c..2970a1eb95170558dd2cbbb8c647f4766a2b3c58 100644 (file)
@@ -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);
     }