3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author João Luis M. Assirati
9 * Full author contact details are available in file CREDITS.
14 #include "support/lyxlib.h"
23 bool lyx::support::putenv(string const & varname, string const & value)
25 static map<string, char *> varmap;
27 string str = varname + '=' + value;
28 char * newptr = new char[str.size() + 1];
29 newptr[str.copy(newptr, string::npos)] = '\0';
30 bool status = (::putenv(newptr) == 0);
32 char * oldptr = varmap[varname];
35 varmap[varname] = newptr;