Only build and use the compat.c bsd_setenv/bsd_putenv/bsd_unsetenv on systems

that don't provide the POSIX setenv().

This fixes building plugins that link to compat.c on OS X (shared libraries on
OS X don't have direct access to environ).  It also reduces the binary size on
platforms which provide setenv(), which these days is most of them.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@382 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2013-10-09 21:40:55 +00:00
parent 040c6abbe4
commit 3de05c07c1
6 changed files with 13 additions and 4 deletions

View File

@@ -3078,7 +3078,7 @@ BUILT_IN_COMMAND(setenvcmd)
char *env_var;
if ((env_var = next_arg(args, &args)) != NULL)
bsd_setenv(env_var, args, 1);
setenv(env_var, args, 1);
else
say("Usage: SETENV <var-name> <value>");
}