mirror of
https://github.com/python/cpython.git
synced 2025-10-18 12:48:57 +00:00
Checkin updated version of patch #103933 . As Thomas says, fixes the bugs #131064, #129584, #127722. See the discussion in bug #131064
This commit is contained in:
parent
af449638b6
commit
5edc627f66
1 changed files with 10 additions and 2 deletions
|
@ -199,6 +199,10 @@ extern const char *PyWin_DLLVersionString;
|
||||||
Ex family of functions so it also works with Windows CE.
|
Ex family of functions so it also works with Windows CE.
|
||||||
|
|
||||||
Returns NULL, or a pointer that should be freed.
|
Returns NULL, or a pointer that should be freed.
|
||||||
|
|
||||||
|
XXX - this code is pretty strange, as it used to also
|
||||||
|
work on Win16, where the buffer sizes werent available
|
||||||
|
in advance. It could be simplied now Win16/Win32s is dead!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
|
@ -279,6 +283,7 @@ getpythonregpath(HKEY keyBase, int skipcore)
|
||||||
}
|
}
|
||||||
RegCloseKey(subKey);
|
RegCloseKey(subKey);
|
||||||
}
|
}
|
||||||
|
/* original datasize from RegQueryInfo doesn't include the \0 */
|
||||||
dataBuf = malloc((dataSize+1) * sizeof(TCHAR));
|
dataBuf = malloc((dataSize+1) * sizeof(TCHAR));
|
||||||
if (dataBuf) {
|
if (dataBuf) {
|
||||||
TCHAR *szCur = dataBuf;
|
TCHAR *szCur = dataBuf;
|
||||||
|
@ -299,8 +304,11 @@ getpythonregpath(HKEY keyBase, int skipcore)
|
||||||
if (skipcore)
|
if (skipcore)
|
||||||
*szCur = '\0';
|
*szCur = '\0';
|
||||||
else {
|
else {
|
||||||
*(szCur++) = _T(';');
|
/* If we have no values, we dont need a ';' */
|
||||||
dataSize--;
|
if (numKeys) {
|
||||||
|
*(szCur++) = _T(';');
|
||||||
|
dataSize--;
|
||||||
|
}
|
||||||
/* Now append the core path entries -
|
/* Now append the core path entries -
|
||||||
this will include the NULL
|
this will include the NULL
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue