summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-12 20:14:01 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-12 20:14:01 (GMT)
commitd08735a54b8aa249482d028a6d998bd9a08ad957 (patch)
tree1f32ae84dffa25a0a3edd3a70301a6bfaa1de57e /PC
parent9c6ba5e901026225b11648ce11ba9d8305286113 (diff)
downloadcpython-d08735a54b8aa249482d028a6d998bd9a08ad957.zip
cpython-d08735a54b8aa249482d028a6d998bd9a08ad957.tar.gz
cpython-d08735a54b8aa249482d028a6d998bd9a08ad957.tar.bz2
Skip empty paths read from the registry.
Diffstat (limited to 'PC')
-rw-r--r--PC/getpath_nt.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/PC/getpath_nt.c b/PC/getpath_nt.c
index 30dd601..2de74f1 100644
--- a/PC/getpath_nt.c
+++ b/PC/getpath_nt.c
@@ -89,12 +89,14 @@ getpythonregpath(HKEY keyBase, BOOL bWin32s)
if (rc) break;
rc = RegQueryValue(newKey, keyBuf, dataBuf+off, &reqdSize);
if (rc) break;
- adjust = strlen(dataBuf+off);
- dataSize -= adjust;
- off += adjust;
- dataBuf[off++] = ';';
- dataBuf[off] = '\0';
- dataSize--;
+ if (reqdSize>1) { // If Nothing, or only '\0' copied.
+ adjust = strlen(dataBuf+off);
+ dataSize -= adjust;
+ off += adjust;
+ dataBuf[off++] = ';';
+ dataBuf[off] = '\0';
+ dataSize--;
+ }
}
/* Additionally, win32s doesnt work as expected, so
the specific strlen() is required for 3.1. */