requires a little tweak if the executable
pathname is *not* absolute: prepend "./"
(otherwise `$^X ...` will start perl from PATH...)
p4raw-id: //depot/perl@13254
if (auxv.a_type == AT_SUN_EXECNAME) {
close(fh);
sv_setpv(sv, auxv.a_un.a_ptr);
+ if (!strchr(SvPVX(sv), '/')) {
+ /* If no slash at all, probably started as "./perl"
+ * Do not compare against "perl", though, since the
+ * binary might be called something else. */
+ STRLEN len;
+ char *s = SvPV(sv, len);
+ SvGROW(sv, len + 2);
+ memmove(s + 2, s, len);
+ SvPVX(sv)[0] = '.';
+ SvPVX(sv)[1] = '/';
+ SvCUR(sv) += 2;
+ }
return;
}
}