]> granicus.if.org Git - python/commitdiff
Insert "./" in front of pathname when it contains no '/' (if USE_SHLIB)
authorGuido van Rossum <guido@python.org>
Fri, 9 Aug 1996 20:55:05 +0000 (20:55 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 9 Aug 1996 20:55:05 +0000 (20:55 +0000)
Python/importdl.c

index 2c1fad0a2f74eb96b5ed1ba806d154851fe476f3..d68b00282b35488eebb2439d8e28a1e8e001d1b1 100644 (file)
@@ -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