diff options
author | Tim Jenness <tjenness@cpan.org> | 2002-06-11 01:55:40 -1000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-06-12 01:35:57 +0000 |
commit | 75745e22e13d8864c5073aba44ed9805a466b45e (patch) | |
tree | c75dc99010b9a14e5b03e7aa4f38674356bae29f /perl.c | |
parent | fc0bf671453fcec7b45b1911adfd5f2cb3c807b5 (diff) | |
download | perl-75745e22e13d8864c5073aba44ed9805a466b45e.tar.gz |
Re: RC1 on Playstation2
Message-ID: <Pine.LNX.4.44.0206111135130.31715-100000@lapaki>
p4raw-id: //depot/perl@17194
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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 |