summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-11-25 03:59:06 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-25 03:59:06 +0000
commitd13ea15cf2b8e1eaa0f689391ed8162333a23e82 (patch)
treeb101a983555c8992fb60fef0280833120e9e3de5 /perl.c
parent158e3910f3d0bce487277fa0db25247b664ed87c (diff)
downloadperl-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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/perl.c b/perl.c
index 9d493adae9..54f68c762b 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;
}
}