summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-01-10 05:42:18 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-01-10 05:42:18 (GMT)
commit0d9f9dcf67c4c044f27cbbc7d3852951869dee53 (patch)
treec63e9c32f4d051bca3a42574b8aa2b5de487eaa4 /Modules
parentfe338ca540b899ded7d26943f4a4d53fe1217155 (diff)
downloadcpython-0d9f9dcf67c4c044f27cbbc7d3852951869dee53.zip
cpython-0d9f9dcf67c4c044f27cbbc7d3852951869dee53.tar.gz
cpython-0d9f9dcf67c4c044f27cbbc7d3852951869dee53.tar.bz2
Windows mmap should (as the docs probably <wink> say) create a mapping
without a name when the optional tagname arg isn't specified. Was actually creating a mapping with an empty string as the name.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/mmapmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index b245c89..332b2da 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -907,7 +907,7 @@ new_mmap_object(PyObject *self, PyObject *args)
m_obj->pos = (size_t) 0;
/* set the tag name */
- if (tagname != NULL) {
+ if (tagname != NULL && *tagname != '\0') {
m_obj->tagname = PyMem_Malloc(strlen(tagname)+1);
if (m_obj->tagname == NULL) {
PyErr_NoMemory();
@@ -924,7 +924,7 @@ new_mmap_object(PyObject *self, PyObject *args)
PAGE_READWRITE,
0,
m_obj->size,
- tagname);
+ m_obj->tagname);
if (m_obj->map_handle != NULL) {
m_obj->data = (char *) MapViewOfFile (m_obj->map_handle,
FILE_MAP_WRITE,