diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-25 03:59:06 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-25 03:59:06 +0000 |
commit | d13ea15cf2b8e1eaa0f689391ed8162333a23e82 (patch) | |
tree | b101a983555c8992fb60fef0280833120e9e3de5 /perl.c | |
parent | 158e3910f3d0bce487277fa0db25247b664ed87c (diff) | |
download | perl-d13ea15cf2b8e1eaa0f689391ed8162333a23e82.tar.gz |
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
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; } } |