Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
5ed19dcc
Kaydet (Commit)
5ed19dcc
authored
Ock 29, 1997
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
posix_execve(): Accept any mapping protocol object for the env
argument, not hardwired to a dictionary.
üst
4acdc232
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
posixmodule.c
Modules/posixmodule.c
+18
-7
No files found.
Modules/posixmodule.c
Dosyayı görüntüle @
5ed19dcc
...
...
@@ -842,7 +842,7 @@ posix_execve(self, args)
PyObject
*
argv
,
*
env
;
char
**
argvlist
;
char
**
envlist
;
PyObject
*
key
,
*
val
;
PyObject
*
key
,
*
val
,
*
keys
=
NULL
,
*
vals
=
NULL
;
int
i
,
pos
,
argc
,
envc
;
PyObject
*
(
*
getitem
)
Py_PROTO
((
PyObject
*
,
int
));
...
...
@@ -864,8 +864,8 @@ posix_execve(self, args)
PyErr_SetString
(
PyExc_TypeError
,
"argv must be tuple or list"
);
return
NULL
;
}
if
(
!
Py
Dict
_Check
(
env
))
{
PyErr_SetString
(
PyExc_TypeError
,
"env must be
dictionary
"
);
if
(
!
Py
Mapping
_Check
(
env
))
{
PyErr_SetString
(
PyExc_TypeError
,
"env must be
mapping object
"
);
return
NULL
;
}
...
...
@@ -884,16 +884,26 @@ posix_execve(self, args)
}
argvlist
[
argc
]
=
NULL
;
i
=
Py
Dict_Size
(
env
);
i
=
Py
Mapping_Length
(
env
);
envlist
=
PyMem_NEW
(
char
*
,
i
+
1
);
if
(
envlist
==
NULL
)
{
PyErr_NoMemory
();
goto
fail_1
;
}
pos
=
0
;
envc
=
0
;
while
(
PyDict_Next
(
env
,
&
pos
,
&
key
,
&
val
))
{
keys
=
PyMapping_Keys
(
env
);
vals
=
PyMapping_Values
(
env
);
if
(
!
keys
||
!
vals
)
goto
fail_2
;
for
(
pos
=
0
;
pos
<
i
;
pos
++
)
{
char
*
p
,
*
k
,
*
v
;
key
=
PyList_GetItem
(
keys
,
pos
);
val
=
PyList_GetItem
(
vals
,
pos
);
if
(
!
key
||
!
val
)
goto
fail_2
;
if
(
!
PyArg_Parse
(
key
,
"s;non-string key in env"
,
&
k
)
||
!
PyArg_Parse
(
val
,
"s;non-string value in env"
,
&
v
))
{
...
...
@@ -926,7 +936,8 @@ posix_execve(self, args)
PyMem_DEL
(
envlist
);
fail_1
:
PyMem_DEL
(
argvlist
);
Py_XDECREF
(
vals
);
Py_XDECREF
(
keys
);
return
NULL
;
}
#endif
/* HAVE_EXECV */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment