summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-03-14 19:05:12 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-03-14 19:05:12 (GMT)
commitccbf475dfde5ef643bf9559b46e97fa9b35ef5d3 (patch)
tree2c13c21d1c81e089ab5b0467bc8294ecb7a89627 /Python/import.c
parentfe19d21815632ba179e32ba1517c1337ac407e97 (diff)
downloadcpython-ccbf475dfde5ef643bf9559b46e97fa9b35ef5d3.zip
cpython-ccbf475dfde5ef643bf9559b46e97fa9b35ef5d3.tar.gz
cpython-ccbf475dfde5ef643bf9559b46e97fa9b35ef5d3.tar.bz2
Fix imp.cache_from_source() if the directory name contains a dot
If the directory name contains a dot but not the filename, don't strip at the dot.
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c
index 3237ddc..e5cb627 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -943,12 +943,12 @@ make_compiled_pathname(Py_UNICODE *pathname, int debug)
Py_UNICODE_strcat(buf, CACHEDIR_UNICODE);
i += Py_UNICODE_strlen(CACHEDIR_UNICODE) - 1;
buf[i++] = sep;
- buf[i++] = '\0';
+ buf[i] = '\0';
/* Add the base filename, but remove the .py or .pyw extension, since
the tag name must go before the extension.
*/
Py_UNICODE_strcat(buf, pathname + save);
- pos = Py_UNICODE_strrchr(buf, '.');
+ pos = Py_UNICODE_strrchr(buf + i, '.');
if (pos != NULL)
*++pos = '\0';
Py_UNICODE_strcat(buf, PYC_TAG_UNICODE);