pp_sys.c: Remove space from lstat($ioref) warning
authorFather Chrysostomos <sprout@cpan.org>
Sat, 14 Jan 2012 06:47:31 +0000 (22:47 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 14 Jan 2012 06:48:47 +0000 (22:48 -0800)
This was emitting two spaces before the ‘at’:

lstat() on filehandle  at -e line 1.

pod/perldiag.pod
pp_sys.c
t/lib/warnings/pp_sys

index 0c638ec..1744721 100644 (file)
@@ -2618,7 +2618,7 @@ because it has already switched from integers to floating point when values
 are too large for integers, and now even floating point is insufficient.
 You may wish to switch to using L<Math::BigInt> explicitly.
 
-=item lstat() on filehandle %s
+=item lstat() on filehandle%s
 
 (W io) You tried to do an lstat on a filehandle.  What did you mean
 by that?  lstat() makes sense only on filenames.  (Perl did a fstat()
index a3b7c51..9d5c09c 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2763,7 +2763,9 @@ PP(pp_stat)
            if (gv != PL_defgv) {
            do_fstat_warning_check:
                Perl_ck_warner(aTHX_ packWARN(WARN_IO),
-                              "lstat() on filehandle %"SVf, SVfARG(gv
+                              "lstat() on filehandle%s%"SVf,
+                               gv ? " " : "",
+                               SVfARG(gv
                                         ? sv_2mortal(newSVhek(GvENAME_HEK(gv)))
                                         : &PL_sv_no));
            } else if (PL_laststype != OP_LSTAT)
index 3df894c..03492c2 100644 (file)
@@ -648,6 +648,7 @@ lstat *FH;
 lstat \*FH;
 open my $fh, $0 or die "# $!";
 lstat $fh;
+lstat *FH{IO};
 no warnings 'io';
 lstat FH;
 lstat $fh;
@@ -658,6 +659,7 @@ lstat() on filehandle FH at - line 4.
 lstat() on filehandle FH at - line 5.
 lstat() on filehandle FH at - line 6.
 lstat() on filehandle $fh at - line 8.
+lstat() on filehandle at - line 9.
 ########
 
 # pp_sys.c [pp_lstat]