From: Tim Jenness Date: Tue, 11 Jun 2002 11:55:40 +0000 (-1000) Subject: Re: RC1 on Playstation2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=75745e22e13d8864c5073aba44ed9805a466b45e;p=p5sagit%2Fp5-mst-13.2.git Re: RC1 on Playstation2 Message-ID: p4raw-id: //depot/perl@17194 --- diff --git a/perl.c b/perl.c index 8566e5f..e4ca5a0 100644 --- a/perl.c +++ b/perl.c @@ -3528,6 +3528,17 @@ S_procself_val(pTHX_ SV *sv, char *arg0) { char buf[MAXPATHLEN]; int len = readlink(PROCSELFEXE_PATH, buf, sizeof(buf) - 1); + + /* On Playstation2 Linux V1.0 (kernel 2.2.1) readlink(/proc/self/exe) + includes a spurious NUL which will cause $^X to fail in system + or backticks (this will prevent extensions from being built and + many tests from working). readlink is not meant to add a NUL. + Normal readlink works fine. + */ + if (len > 0 && buf[len-1] == '\0') { + len--; + } + /* FreeBSD's implementation is acknowledged to be imperfect, sometimes returning the text "unknown" from the readlink rather than the path to the executable (or returning an error from the readlink). Any valid