[Python-checkins] CVS: python/dist/src/PC getpathp.c,1.22,1.22.2.1

Moshe Zadka moshez@users.sourceforge.net
Wed, 11 Apr 2001 01:01:27 -0700


Update of /cvsroot/python/python/dist/src/PC
In directory usw-pr-cvs1:/tmp/cvs-serv16946/PC

Modified Files:
      Tag: release20-maint
	getpathp.c 
Log Message:
Checking the diff from PC/getpatchp.c 1.22 to 1.23
This fixes many bugs, and was proposed by Thomas Heller.
Original 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.22.2.1
diff -C2 -r1.22 -r1.22.2.1
*** getpathp.c	2000/10/07 11:10:50	1.22
--- getpathp.c	2001/04/11 08:01:24	1.22.2.1
***************
*** 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