diff Python/importdl.c @ 3988:efb3a5a2cdea legacy-trunk

Insert "./" in front of pathname when it contains no '/' (if USE_SHLIB)
author Guido van Rossum <guido@python.org>
date Fri, 09 Aug 1996 20:55:05 +0000
parents ac1d5abfd78e
children 6b4d0f1a0ae9
line wrap: on
line diff
--- a/Python/importdl.c	Fri Aug 09 20:53:24 1996 +0000
+++ b/Python/importdl.c	Fri Aug 09 20:55:05 1996 +0000
@@ -242,6 +242,12 @@
 		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