From 072daaee0ad49f2c6c78b9cdab59897be85631e2 Mon Sep 17 00:00:00 2001 From: Peter Date: Mon, 23 May 2011 21:35:13 +0200 Subject: [PATCH] always color to stdout --- tools/osmpbf-outline.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tools/osmpbf-outline.cpp b/tools/osmpbf-outline.cpp index 352c9f9..b47f004 100644 --- a/tools/osmpbf-outline.cpp +++ b/tools/osmpbf-outline.cpp @@ -5,8 +5,6 @@ #include #include -bool is_a_tty; - const int MAX_BLOB_HEADER_SIZE = 64 * 1024; const int MAX_BLOB_SIZE = 32 * 1024 * 1024; @@ -21,12 +19,9 @@ OSMPBF::HeaderBlock osmheader; * prints a formatted message to stderr, optionally color coded */ void msg(const char* format, int color, va_list args) { - if(is_a_tty) fprintf(stderr, "\x1b[0;%dm", color); - - vfprintf(stderr, format, args); - - if(is_a_tty) fprintf(stderr, "\x1b[0m\n"); - else fprintf(stderr, "\n"); + fprintf(stdout, "\x1b[0;%dm", color); + vfprintf(stdout, format, args); + fprintf(stdout, "\x1b[0m\n"); } /** @@ -74,9 +69,6 @@ void debug(const char* format, ...) { * application main method */ int main(int argc, char *argv[]) { - // check if stderr is a tty and set a global bool - is_a_tty = (bool)isatty(2); - // check for proper command line args if(argc != 2) err("usage: %s file.osm.pbf", argv[0]);