Branch: Tag:

2008-06-10

2008-06-10 20:56:26 by Martin Stjernholm <mast@lysator.liu.se>

Fixed putenv on windows (hopefully).

Rev: src/builtin.cmod:1.205
Rev: src/configure.in:1.1054

2:   || 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"
1345:    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)