diff options
author | Guido van Rossum <guido@python.org> | 1996-08-09 20:55:05 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-08-09 20:55:05 (GMT) |
commit | 0bbf253e97f3ad04436b26ad4ba2a539f99f1116 (patch) | |
tree | bad028913ee61a6c3e3aab9590e835054035ae9c | |
parent | 2878a69922548c9f663779e8c0087b24530d203e (diff) | |
download | cpython-0bbf253e97f3ad04436b26ad4ba2a539f99f1116.zip cpython-0bbf253e97f3ad04436b26ad4ba2a539f99f1116.tar.gz cpython-0bbf253e97f3ad04436b26ad4ba2a539f99f1116.tar.bz2 |
Insert "./" in front of pathname when it contains no '/' (if USE_SHLIB)
-rw-r--r-- | Python/importdl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/importdl.c b/Python/importdl.c index 2c1fad0..d68b002 100644 --- a/Python/importdl.c +++ b/Python/importdl.c @@ -242,6 +242,12 @@ load_dynamic_module(name, pathname, fp) void *handle; } handles[128]; static int nhandles = 0; + char pathbuf[260]; + if (strchr(pathname, '/') == NULL) { + /* Prefix bare filename with "./" */ + sprintf(pathbuf, "./%-.255s", pathname); + pathname = pathbuf; + } #endif sprintf(funcname, FUNCNAME_PATTERN, name); #ifdef USE_SHLIB |