summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2015-02-04 09:34:39 +0100
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:06 +0100
commit6aec9f7560daa005c513cde384f063f0b9b55dbc (patch)
treea6fe2617f91c6670a4584ef23f89e668dabb325d
parentb15e72c5fbf217de1aacd3fbf6769dc0cb83d208 (diff)
remove the (generally unsecure) setenv command
-rw-r--r--src/client/cl_main.c1
-rw-r--r--src/qcommon/common.c30
-rw-r--r--src/qcommon/qcommon.h2
-rw-r--r--src/renderercommon/tr_public.h1
-rw-r--r--src/sys/sys_unix.c16
-rw-r--r--src/sys/sys_win32.c15
6 files changed, 0 insertions, 65 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index 543c9b4f..ac7d6356 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -3349,7 +3349,6 @@ void CL_InitRef( void ) {
ri.ftol = Q_ftol;
- ri.Sys_SetEnv = Sys_SetEnv;
ri.Sys_GLimpSafeInit = Sys_GLimpSafeInit;
ri.Sys_GLimpInit = Sys_GLimpInit;
ri.Sys_LowPhysicalMemory = Sys_LowPhysicalMemory;
diff --git a/src/qcommon/common.c b/src/qcommon/common.c
index 80a8df7b..59659ef0 100644
--- a/src/qcommon/common.c
+++ b/src/qcommon/common.c
@@ -2293,35 +2293,6 @@ static void Com_Crash_f( void ) {
/*
==================
-Com_Setenv_f
-
-For controlling environment variables
-==================
-*/
-void Com_Setenv_f(void)
-{
- int argc = Cmd_Argc();
- char *arg1 = Cmd_Argv(1);
-
- if(argc > 2)
- {
- char *arg2 = Cmd_ArgsFrom(2);
-
- Sys_SetEnv(arg1, arg2);
- }
- else if(argc == 2)
- {
- char *env = getenv(arg1);
-
- if(env)
- Com_Printf("%s=%s\n", arg1, env);
- else
- Com_Printf("%s undefined\n", arg1);
- }
-}
-
-/*
-==================
Com_ExecuteCfg
For controlling environment variables
@@ -2556,7 +2527,6 @@ void Com_Init( char *commandLine ) {
Com_InitJournaling();
// Add some commands here already so users can use them from config files
- Cmd_AddCommand ("setenv", Com_Setenv_f);
if (com_developer && com_developer->integer)
{
Cmd_AddCommand ("error", Com_Error_f);
diff --git a/src/qcommon/qcommon.h b/src/qcommon/qcommon.h
index 0e90963a..e8764ef3 100644
--- a/src/qcommon/qcommon.h
+++ b/src/qcommon/qcommon.h
@@ -1093,8 +1093,6 @@ void Sys_Sleep(int msec);
qboolean Sys_LowPhysicalMemory( void );
-void Sys_SetEnv(const char *name, const char *value);
-
typedef enum
{
DR_YES = 0,
diff --git a/src/renderercommon/tr_public.h b/src/renderercommon/tr_public.h
index 995133e9..ebe23d24 100644
--- a/src/renderercommon/tr_public.h
+++ b/src/renderercommon/tr_public.h
@@ -178,7 +178,6 @@ typedef struct {
long (*ftol)(float f);
// system stuff
- void (*Sys_SetEnv)( const char *name, const char *value );
void (*Sys_GLimpSafeInit)( void );
void (*Sys_GLimpInit)( void );
qboolean (*Sys_LowPhysicalMemory)( void );
diff --git a/src/sys/sys_unix.c b/src/sys/sys_unix.c
index 3caed9fd..f3dd0406 100644
--- a/src/sys/sys_unix.c
+++ b/src/sys/sys_unix.c
@@ -812,22 +812,6 @@ void Sys_PlatformExit( void )
/*
==============
-Sys_SetEnv
-
-set/unset environment variables (empty value removes it)
-==============
-*/
-
-void Sys_SetEnv(const char *name, const char *value)
-{
- if(value && *value)
- setenv(name, value, 1);
- else
- unsetenv(name);
-}
-
-/*
-==============
Sys_PID
==============
*/
diff --git a/src/sys/sys_win32.c b/src/sys/sys_win32.c
index fb0f51a7..635b157f 100644
--- a/src/sys/sys_win32.c
+++ b/src/sys/sys_win32.c
@@ -686,21 +686,6 @@ void Sys_PlatformExit( void )
/*
==============
-Sys_SetEnv
-
-set/unset environment variables (empty value removes it)
-==============
-*/
-void Sys_SetEnv(const char *name, const char *value)
-{
- if(value)
- _putenv(va("%s=%s", name, value));
- else
- _putenv(va("%s=", name));
-}
-
-/*
-==============
Sys_PID
==============
*/