From: Jarkko Hietaniemi Date: Sun, 25 Nov 2001 03:59:06 +0000 (+0000) Subject: The new way of finding out $^X in Solaris X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d13ea15cf2b8e1eaa0f689391ed8162333a23e82;p=p5sagit%2Fp5-mst-13.2.git The new way of finding out $^X in Solaris requires a little tweak if the executable pathname is *not* absolute: prepend "./" (otherwise `$^X ...` will start perl from PATH...) p4raw-id: //depot/perl@13254 --- diff --git a/perl.c b/perl.c index 9d493ad..54f68c7 100644 --- a/perl.c +++ b/perl.c @@ -3452,6 +3452,18 @@ S_procselfauxv(pTHX_ SV *sv, char *arg0) { 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; } }