summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common.c10
-rw-r--r--src/common.h2
-rw-r--r--src/sys_unix.c9
3 files changed, 10 insertions, 11 deletions
diff --git a/src/common.c b/src/common.c
index ffe22ed..2186d79 100644
--- a/src/common.c
+++ b/src/common.c
@@ -89,6 +89,9 @@ cvar_t *allow_download_others;
cvar_t *rcon_password;
+const char com_version_string[] =
+ APPLICATION " " VERSION " " __DATE__ " " BUILDSTRING " " CPUSTRING;
+
qhandle_t com_logFile;
qboolean com_logNewline;
unsigned com_framenum;
@@ -1909,8 +1912,6 @@ Qcommon_Init
=================
*/
void Qcommon_Init( int argc, char **argv ) {
- static const char version[] = APPLICATION " " VERSION " " __DATE__ " " BUILDSTRING " " CPUSTRING;
-
if( setjmp( abortframe ) )
Sys_Error( "Error during initialization: %s", com_errorMsg );
@@ -1970,7 +1971,7 @@ void Qcommon_Init( int argc, char **argv ) {
com_debug_break = Cvar_Get( "com_debug_break", "0", 0 );
#endif
com_fatal_error = Cvar_Get( "com_fatal_error", "0", 0 );
- com_version = Cvar_Get( "version", version, CVAR_SERVERINFO|CVAR_ROM );
+ com_version = Cvar_Get( "version", com_version_string, CVAR_SERVERINFO|CVAR_ROM );
allow_download = Cvar_Get( "allow_download", Com_IsDedicated() ? "0" : "1", CVAR_ARCHIVE );
allow_download_players = Cvar_Get( "allow_download_players", "1", CVAR_ARCHIVE );
@@ -2009,9 +2010,6 @@ void Qcommon_Init( int argc, char **argv ) {
Sys_RunConsole();
#endif
- // print version
- Com_LPrintf( PRINT_NOTICE, "%s\n", version );
-
FS_Init();
#if USE_SYSCON
diff --git a/src/common.h b/src/common.h
index 944fa16..28c8354 100644
--- a/src/common.h
+++ b/src/common.h
@@ -622,6 +622,8 @@ extern unsigned time_before_ref;
extern unsigned time_after_ref;
#endif
+extern const char com_version_string[];
+
extern unsigned com_eventTime; // system time of the last event
extern unsigned com_localTime; // milliseconds since Q2 startup
extern unsigned com_framenum;
diff --git a/src/sys_unix.c b/src/sys_unix.c
index a7ffcb7..0db6141 100644
--- a/src/sys_unix.c
+++ b/src/sys_unix.c
@@ -952,19 +952,18 @@ main
int main( int argc, char **argv ) {
if( argc > 1 ) {
if( !strcmp( argv[1], "-v" ) || !strcmp( argv[1], "--version" ) ) {
- printf( APPLICATION " " VERSION " " __DATE__ " " BUILDSTRING " "
- CPUSTRING "\n" );
+ fprintf( stderr, "%s\n", com_version_string );
return 0;
}
if( !strcmp( argv[1], "-h" ) || !strcmp( argv[1], "--help" ) ) {
- printf( "Usage: %s [+command arguments] [...]\n", argv[0] );
+ fprintf( stderr, "Usage: %s [+command arguments] [...]\n", argv[0] );
return 0;
}
}
if( !getuid() || !geteuid() ) {
- printf( "You can not run " APPLICATION " as superuser "
- "for security reasons!\n" );
+ fprintf( stderr, "You can not run " PRODUCT " as superuser "
+ "for security reasons!\n" );
return 1;
}