[vlc-devel] commit: Do not use print colored help if stdout is not a TTY ( Rémi Denis-Courmont )
git version control
git at videolan.org
Thu Jun 5 19:08:20 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Thu Jun 5 20:10:04 2008 +0300| [446bfcd5f40d640097b4e765ae234c47b9831d12]
Do not use print colored help if stdout is not a TTY
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=446bfcd5f40d640097b4e765ae234c47b9831d12
---
src/libvlc.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/libvlc.c b/src/libvlc.c
index e06a719..9c60cab 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -1328,9 +1328,10 @@ static void Usage( libvlc_int_t *p_this, char const *psz_module_name )
psz_spaces_text[PADDING_SPACES+LINE_START] = '\0';
memset( psz_spaces_longtext, ' ', LINE_START+2 );
psz_spaces_longtext[LINE_START+2] = '\0';
-#ifdef WIN32
- b_color = false; // don't put color control codes in a .txt file
+#ifndef WIN32
+ if( !isatty( 1 ) )
#endif
+ b_color = false; // don't put color control codes in a .txt file
if( b_color )
{
More information about the vlc-devel
mailing list