[Python-checkins] CVS: python/dist/src/PC getpathp.c,1.22,1.23
Mark Hammond
mhammond@users.sourceforge.net
Fri, 23 Feb 2001 03:38:40 -0800
Update of /cvsroot/python/python/dist/src/PC
In directory usw-pr-cvs1:/tmp/cvs-serv27146
Modified Files:
getpathp.c
Log Message:
Checkin updated version of patch #103933 . As Thomas says, fixes the bugs #131064, #129584, #127722. See the discussion in bug #131064
Index: getpathp.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/getpathp.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** getpathp.c 2000/10/07 11:10:50 1.22
--- getpathp.c 2001/02/23 11:38:38 1.23
***************
*** 200,203 ****
--- 200,207 ----
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!
*/
***************
*** 280,283 ****
--- 284,288 ----
RegCloseKey(subKey);
}
+ /* original datasize from RegQueryInfo doesn't include the \0 */
dataBuf = malloc((dataSize+1) * sizeof(TCHAR));
if (dataBuf) {
***************
*** 300,305 ****
*szCur = '\0';
else {
! *(szCur++) = _T(';');
! dataSize--;
/* Now append the core path entries -
this will include the NULL
--- 305,313 ----
*szCur = '\0';
else {
! /* If we have no values, we dont need a ';' */
! if (numKeys) {
! *(szCur++) = _T(';');
! dataSize--;
! }
/* Now append the core path entries -
this will include the NULL