]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/blobdiff - src/coloredstderr.c
Update copyright year.
[coloredstderr/coloredstderr.git] / src / coloredstderr.c
index 4664f0d1a8d0efb033fb11bf28814fc4a730d12c..c36e7d70d3688a4d5c234dd7b0a33c5d22e0e14c 100644 (file)
@@ -2,7 +2,7 @@
  * Hook output functions (like printf(3)) with LD_PRELOAD to color stderr (or
  * other file descriptors).
  *
- * Copyright (C) 2013  Simon Ruderich
+ * Copyright (C) 2013-2014  Simon Ruderich
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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);
     }