Skip to content

Commit c02b41b

Browse files
authored
bpo-38353: getpath.c: allocates strings on the heap (GH-16585)
* _Py_FindEnvConfigValue() now returns a string allocated by PyMem_RawMalloc(). * calculate_init() now decodes VPATH macro. * Add calculate_open_pyenv() function. * Add substring() and joinpath2() functions. * Fix add_exe_suffix() And a few cleanup changes.
1 parent abd7cd8 commit c02b41b

File tree

4 files changed

+421
-313
lines changed

4 files changed

+421
-313
lines changed

Include/internal/pycore_pathconfig.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ extern PyStatus _PyPathConfig_Calculate(
5656
extern int _PyPathConfig_ComputeSysPath0(
5757
const PyWideStringList *argv,
5858
PyObject **path0);
59-
extern int _Py_FindEnvConfigValue(
59+
extern PyStatus _Py_FindEnvConfigValue(
6060
FILE *env_file,
6161
const wchar_t *key,
62-
wchar_t *value,
63-
size_t value_size);
62+
wchar_t **value_p);
6463

6564
#ifdef MS_WINDOWS
6665
extern wchar_t* _Py_GetDLLPath(void);

0 commit comments

Comments
 (0)