In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/5fe499a8e26270679c0c6d48431f3a328a8ffeba?hp=84ad9c6c2d2072cd602e0f4ee76fd4ac5107dc3d>

- Log -----------------------------------------------------------------
commit 5fe499a8e26270679c0c6d48431f3a328a8ffeba
Author: Tony Cook <[email protected]>
Date:   Wed Feb 4 16:10:20 2015 +1100

    [perl #123218] "preserve" $/ if set to a bad value
    
    and base/rs.t tests $/ not $!
-----------------------------------------------------------------------

Summary of changes:
 mg.c        |  1 +
 t/base/rs.t | 11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/mg.c b/mg.c
index 58427a4..237b404 100644
--- a/mg.c
+++ b/mg.c
@@ -1105,6 +1105,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
     case ':':
        break;
     case '/':
+        sv_setsv(sv, PL_rs);
        break;
     case '[':
        sv_setiv(sv, 0);
diff --git a/t/base/rs.t b/t/base/rs.t
index c81b2dc..6f3c4b5 100644
--- a/t/base/rs.t
+++ b/t/base/rs.t
@@ -1,7 +1,7 @@
 #!./perl
-# Test $!
+# Test $/
 
-print "1..38\n";
+print "1..39\n";
 
 $test_count = 1;
 $teststring = "1\n12\n123\n1234\n1234\n12345\n\n123456\n1234567\n";
@@ -34,8 +34,13 @@ test_record(*TESTFILE);
 close TESTFILE;
 $test_count_end = $test_count;  # Needed to know how many tests to skip
 
+$/ = "\n";
+my $note = "\$/ preserved when set to bad value";
+# none of the setting of $/ to bad values should modify its value
 test_bad_setting();
-
+print +($/ ne "\n" ? "not " : "") .
+  "ok $test_count # \$/ preserved when set to bad value\n";
+++$test_count;
 
 # Now for the tricky bit--full record reading
 if ($^O eq 'VMS') {

--
Perl5 Master Repository

Reply via email to