summaryrefslogtreecommitdiff
path: root/source/sys_unix.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2007-12-27 21:20:17 +0000
committerAndrey Nazarov <skuller@skuller.net>2007-12-27 21:20:17 +0000
commitc28be89eba22dd3b8f9c3308f92d8742f4f8fc84 (patch)
treec5f905c63f91f455f9a38ac15a4bc7d4cf709c54 /source/sys_unix.c
parent1062f46b214a1fa9044879279f82abe15293dc37 (diff)
Updated revision to 170.
Removed `com_sleep' variable. Fixed master heartbeat timings. Enabled anticheat server interface for Windows builds. Added `--single-user' option to configure script. Build `q2pro-client' and `q2pro-server' binary *.deb packages by default. Allow absolute homedir path, autoexpand `~' character on Unix.
Diffstat (limited to 'source/sys_unix.c')
-rw-r--r--source/sys_unix.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/sys_unix.c b/source/sys_unix.c
index 071c9c4..8c10db9 100644
--- a/source/sys_unix.c
+++ b/source/sys_unix.c
@@ -762,8 +762,7 @@ Sys_Init
=================
*/
void Sys_Init( void ) {
- char homedir[MAX_OSPATH];
- char *s;
+ char *homedir;
signal( SIGTERM, Sys_Kill );
signal( SIGINT, Sys_Kill );
@@ -777,11 +776,15 @@ void Sys_Init( void ) {
// homedir <path>
// specifies per-user writable directory for demos, screenshots, etc
- s = getenv( "HOME" );
- if( s && *s ) {
- Q_concat( homedir, sizeof( homedir ), s, "/" HOMEDIR, NULL );
+ if( HOMEDIR[0] == '~' ) {
+ char *s = getenv( "HOME" );
+ if( s && *s ) {
+ homedir = va( "%s%s", s, HOMEDIR + 1 );
+ } else {
+ homedir = "";
+ }
} else {
- homedir[0] = 0;
+ homedir = HOMEDIR;
}
sys_homedir = Cvar_Get( "homedir", homedir, CVAR_NOSET );