diff --git a/src/ModuleLoader.pm b/src/ModuleLoader.pm index 70224eb384..cddae0509b 100644 --- a/src/ModuleLoader.pm +++ b/src/ModuleLoader.pm @@ -123,6 +123,9 @@ knowhow ModuleLoader { # May be fake executable, so may not end in .pbc. If so, add it. # Strip any .exe. my $module_name := ((pir::getinterp__P())[2])[0]; + if pir::substr($module_name, 0, 2) eq './' { + $module_name := pir::substr($module_name, 2, pir::length($module_name) - 2); + } if pir::substr($module_name, pir::length($module_name) - 4, 4) eq '.pbc' { # Fine as it is. }