mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Some more changes to make code compile under a C++ compiler.
This commit is contained in:
parent
7b782b61c5
commit
64182fe0b3
5 changed files with 11 additions and 10 deletions
|
|
@ -6009,7 +6009,7 @@ static PyObject *
|
|||
posix_putenv(PyObject *self, PyObject *args)
|
||||
{
|
||||
char *s1, *s2;
|
||||
char *new;
|
||||
char *newenv;
|
||||
PyObject *newstr;
|
||||
size_t len;
|
||||
|
||||
|
|
@ -6040,9 +6040,9 @@ posix_putenv(PyObject *self, PyObject *args)
|
|||
newstr = PyString_FromStringAndSize(NULL, (int)len - 1);
|
||||
if (newstr == NULL)
|
||||
return PyErr_NoMemory();
|
||||
new = PyString_AS_STRING(newstr);
|
||||
PyOS_snprintf(new, len, "%s=%s", s1, s2);
|
||||
if (putenv(new)) {
|
||||
newenv = PyString_AS_STRING(newstr);
|
||||
PyOS_snprintf(newenv, len, "%s=%s", s1, s2);
|
||||
if (putenv(newenv)) {
|
||||
Py_DECREF(newstr);
|
||||
posix_error();
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue