summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-10-13 15:53:39 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-10-13 15:53:39 +0000
commitb1681ed3d2d7fce28f676043b07816f4fad94f55 (patch)
treebac72e96dde17083b4015bd2d0381b9b818860c3
parent13414bd57a95312231e2bee41d173b09580d2351 (diff)
downloadperl-b1681ed3d2d7fce28f676043b07816f4fad94f55.tar.gz
If /dev/null is not readable, perl -e fails with
an obscure error message. Make it more understandable. p4raw-id: //depot/perl@25753
-rw-r--r--perl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index a1667c8404..42f32fed29 100644
--- a/perl.c
+++ b/perl.c
@@ -3607,8 +3607,11 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, SV *sv)
#endif /* IAMSUID */
if (!PL_rsfp) {
/* PSz 16 Sep 03 Keep neat error message */
- Perl_croak(aTHX_ "Can't open perl script \"%s\": %s\n",
- CopFILE(PL_curcop), Strerror(errno));
+ if (PL_e_script)
+ Perl_croak(aTHX_ "Can't open "BIT_BUCKET": %s\n", Strerror(errno));
+ else
+ Perl_croak(aTHX_ "Can't open perl script \"%s\": %s\n",
+ CopFILE(PL_curcop), Strerror(errno));
}
}