]> git.sesse.net Git - vlc/commitdiff
* src/libvlc.c: on win32, redirect stdout to vlc-help.txt when printing the help.
authorGildas Bazin <gbazin@videolan.org>
Mon, 5 Sep 2005 19:23:29 +0000 (19:23 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 5 Sep 2005 19:23:29 +0000 (19:23 +0000)
src/libvlc.c

index 66a8d3940a1ed927f094c813b4f6375517dd6db8..df0ae2e2c2b3b47853be6ffdef9999b23666d309 100644 (file)
@@ -2422,11 +2422,21 @@ static void Version( void )
 static void ShowConsole( void )
 {
 #   ifndef UNDER_CE
+    FILE *f_help;
 
     if( getenv( "PWD" ) && getenv( "PS1" ) ) return; /* cygwin shell */
 
     AllocConsole();
-    freopen( "CONOUT$", "w", stdout );
+
+    if( (f_help = fopen( "vlc-help.txt", "wt" )) )
+    {
+        fclose( f_help );
+        freopen( "vlc-help.txt", "wt", stdout );
+        fprintf( stderr, _("\nDumped content to vlc-help.txt file.\n") );
+    }
+
+    else freopen( "CONOUT$", "w", stdout );
+
     freopen( "CONOUT$", "w", stderr );
     freopen( "CONIN$", "r", stdin );
 
@@ -2445,8 +2455,10 @@ static void PauseConsole( void )
 #   ifndef UNDER_CE
 
     if( getenv( "PWD" ) && getenv( "PS1" ) ) return; /* cygwin shell */
-    fprintf( stdout, _("\nPress the RETURN key to continue...\n") );
+
+    fprintf( stderr, _("\nPress the RETURN key to continue...\n") );
     getchar();
+    fclose( stdout );
 
 #   endif
 }