summaryrefslogtreecommitdiff
path: root/source/sys_win.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2007-12-21 21:24:49 +0000
committerAndrey Nazarov <skuller@skuller.net>2007-12-21 21:24:49 +0000
commitb1fa1be8b67e6d34a3d11fe4bfb9cd27191e2b28 (patch)
tree878887f017a82f7b861464c683d9a908e6d0a18e /source/sys_win.c
parenta79ed051848531afb9a479f280bbcc39a4c29f44 (diff)
Use Sys_Setenv for setting environment variables in a safe way.
Moved `writeconfig' command to client code section. Moved `setenv' command to common code section. Properly handle `--help' -and `--version' arguments on Unix.
Diffstat (limited to 'source/sys_win.c')
-rw-r--r--source/sys_win.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/sys_win.c b/source/sys_win.c
index 03464da..0d14246 100644
--- a/source/sys_win.c
+++ b/source/sys_win.c
@@ -774,6 +774,15 @@ void Sys_Sleep( int msec ) {
Sleep( msec );
}
+void Sys_Setenv( const char *name, const char *value ) {
+#if( _MSC_VER >= 1400 )
+ _putenv_s( name, value );
+#else
+ _putenv( va( "%s=%s", name, value ) );
+#endif
+}
+
+
/*
================
Sys_Init