summaryrefslogtreecommitdiff
path: root/src/sys/sys_win32.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2009-11-16 00:23:28 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:20 +0000
commit21674b587ca1aa1e956b66ae6e613d5afb2111d3 (patch)
treeef74238d6371114ac0f773eacd209f728225ffb9 /src/sys/sys_win32.c
parentd22e46c9afdaf65a06ed0836d4f7e2b9e689e4d9 (diff)
* Merge ioq3-r1752
Diffstat (limited to 'src/sys/sys_win32.c')
-rw-r--r--src/sys/sys_win32.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/sys/sys_win32.c b/src/sys/sys_win32.c
index 18efe406..e5b0cb00 100644
--- a/src/sys/sys_win32.c
+++ b/src/sys/sys_win32.c
@@ -77,14 +77,6 @@ char *Sys_DefaultHomePath( void )
Q_strncpyz( homePath, szPath, sizeof( homePath ) );
Q_strcat( homePath, sizeof( homePath ), "\\Tremulous" );
FreeLibrary(shfolder);
- if( !CreateDirectory( homePath, NULL ) )
- {
- if( GetLastError() != ERROR_ALREADY_EXISTS )
- {
- Com_Printf("Unable to create directory \"%s\"\n", homePath );
- return NULL;
- }
- }
}
return homePath;
@@ -279,9 +271,15 @@ const char *Sys_Dirname( char *path )
Sys_Mkdir
==============
*/
-void Sys_Mkdir( const char *path )
+qboolean Sys_Mkdir( const char *path )
{
- _mkdir (path);
+ if( !CreateDirectory( path, NULL ) )
+ {
+ if( GetLastError( ) != ERROR_ALREADY_EXISTS )
+ return qfalse;
+ }
+
+ return qtrue;
}
/*
@@ -652,3 +650,16 @@ void Sys_PlatformInit( void )
SDL_VIDEODRIVER_externallySet = qfalse;
#endif
}
+
+/*
+==============
+Sys_SetEnv
+
+set/unset environment variables (empty value removes it)
+==============
+*/
+
+void Sys_SetEnv(const char *name, const char *value)
+{
+ _putenv(va("%s=%s", name, value));
+}