Skip empty paths read from the registry.

This commit is contained in:
Guido van Rossum 1997-01-12 20:14:01 +00:00
parent 9c6ba5e901
commit d08735a54b
1 changed files with 8 additions and 6 deletions

View File

@ -89,6 +89,7 @@ getpythonregpath(HKEY keyBase, BOOL bWin32s)
if (rc) break;
rc = RegQueryValue(newKey, keyBuf, dataBuf+off, &reqdSize);
if (rc) break;
if (reqdSize>1) { // If Nothing, or only '\0' copied.
adjust = strlen(dataBuf+off);
dataSize -= adjust;
off += adjust;
@ -96,6 +97,7 @@ getpythonregpath(HKEY keyBase, BOOL bWin32s)
dataBuf[off] = '\0';
dataSize--;
}
}
/* Additionally, win32s doesnt work as expected, so
the specific strlen() is required for 3.1. */
rc = RegQueryValue(newKey, "", dataBuf+off, &dataSize);