summaryrefslogtreecommitdiff
path: root/src/sys/sys_win32.c
diff options
context:
space:
mode:
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));
+}