#ifdef WIN32
static void ShowConsole ( void );
+static void PauseConsole ( void );
#endif
static int ConsoleWidth ( void );
ShowConsole();
/* Pause the console because it's destroyed when we exit */
fprintf( stderr, "The command line options couldn't be loaded, check "
- "that they are valid.\nPress the RETURN key to continue..." );
- getchar();
+ "that they are valid.\n" );
+ PauseConsole();
#endif
vlc_object_detach( p_help_module );
config_Free( p_help_module );
vlc_list_release( p_list );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
- fprintf( stdout, _("\nPress the RETURN key to continue...\n") );
- getchar();
+ PauseConsole();
#endif
}
vlc_list_release( p_list );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
- fprintf( stdout, _("\nPress the RETURN key to continue...\n") );
- getchar();
+ PauseConsole();
#endif
}
"Written by the VideoLAN team; see the AUTHORS file.\n") );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
- fprintf( stdout, _("\nPress the RETURN key to continue...\n") );
- getchar();
+ PauseConsole();
#endif
}
freopen( "CONOUT$", "w", stdout );
freopen( "CONOUT$", "w", stderr );
freopen( "CONIN$", "r", stdin );
+
# endif
+}
+#endif
+
+/*****************************************************************************
+ * PauseConsole: On Win32, wait for a key press before closing the console
+ *****************************************************************************
+ * This function is useful only on Win32.
+ *****************************************************************************/
+#ifdef WIN32 /* */
+static void PauseConsole( void )
+{
+# ifndef UNDER_CE
- return;
+ if( getenv( "PWD" ) && getenv( "PS1" ) ) return; /* cygwin shell */
+ fprintf( stdout, _("\nPress the RETURN key to continue...\n") );
+ getchar();
+
+# endif
}
#endif