pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:1:
/* -*- c -*- || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: builtin.cmod,v 1.
204
2008/06/10
12
:
16
:
17
mast Exp $
+
|| $Id: builtin.cmod,v 1.
205
2008/06/10
20
:
56
:
26
mast Exp $
*/ #include "global.h" #include "interpret.h" #include "svalue.h" #include "pike_macros.h" #include "object.h" #include "program.h" #include "array.h" #include "pike_error.h"
pike.git/src/builtin.cmod:1338:
if (string_has_null (val)) SIMPLE_ARG_ERROR ("putenv", 2, "Variable value cannot contain NUL."); init_string_builder (&sb, 0); string_builder_shared_strcat (&sb, var); string_builder_putchar (&sb, '='); string_builder_shared_strcat (&sb, val); putenv_str = finish_string_builder (&sb); push_string (putenv_str); /* Let mega_apply pop. */ }
-
else
+
else
{
+
#ifdef PUTENV_ALWAYS_REQUIRES_EQUAL
+
/* Windows can never get things quite right.. :P */
+
struct string_builder sb;
+
init_string_builder (&sb, 0);
+
string_builder_shared_strcat (&sb, var);
+
string_builder_putchar (&sb, '=');
+
putenv_str = finish_string_builder (&sb);
+
push_string (putenv_str); /* Let mega_apply pop. */
+
#else
putenv_str = var;
-
+
#endif
+
}
if (putenv (putenv_str->str)) { if (errno == ENOMEM) SIMPLE_OUT_OF_MEMORY_ERROR ("putenv", 0); else Pike_error ("Error from putenv(3): %s\n", strerror (errno)); } #ifdef __NT__ ref_push_string (var);