File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,10 @@ extern const char *PyWin_DLLVersionString;
199
199
Ex family of functions so it also works with Windows CE.
200
200
201
201
Returns NULL, or a pointer that should be freed.
202
+
203
+ XXX - this code is pretty strange, as it used to also
204
+ work on Win16, where the buffer sizes werent available
205
+ in advance. It could be simplied now Win16/Win32s is dead!
202
206
*/
203
207
204
208
static char *
@@ -279,6 +283,7 @@ getpythonregpath(HKEY keyBase, int skipcore)
279
283
}
280
284
RegCloseKey (subKey );
281
285
}
286
+ /* original datasize from RegQueryInfo doesn't include the \0 */
282
287
dataBuf = malloc ((dataSize + 1 ) * sizeof (TCHAR ));
283
288
if (dataBuf ) {
284
289
TCHAR * szCur = dataBuf ;
@@ -299,8 +304,11 @@ getpythonregpath(HKEY keyBase, int skipcore)
299
304
if (skipcore )
300
305
* szCur = '\0' ;
301
306
else {
302
- * (szCur ++ ) = _T (';' );
303
- dataSize -- ;
307
+ /* If we have no values, we dont need a ';' */
308
+ if (numKeys ) {
309
+ * (szCur ++ ) = _T (';' );
310
+ dataSize -- ;
311
+ }
304
312
/* Now append the core path entries -
305
313
this will include the NULL
306
314
*/
You can’t perform that action at this time.
0 commit comments