Fix PVLV case in sv_setsv (plus tests in op/pat.t).
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>
Thu, 27 Nov 1997 14:48:58 +0000 (14:48 +0000)
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>
Thu, 27 Nov 1997 14:48:58 +0000 (14:48 +0000)
p4raw-id: //depot/perl@315

sv.c
t/op/pat.t

diff --git a/sv.c b/sv.c
index 9a7f075..77feae2 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -1889,10 +1889,6 @@ sv_setsv(SV *dstr, register SV *sstr)
            sv_upgrade(dstr, SVt_PVNV);
        break;
 
-    case SVt_PVLV:
-       sv_upgrade(dstr, SVt_PVLV);
-       break;
-
     case SVt_PVAV:
     case SVt_PVHV:
     case SVt_PVCV:
index 03af122..a9e6869 100755 (executable)
@@ -2,7 +2,7 @@
 
 # $RCSfile: pat.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:12 $
 
-print "1..97\n";
+print "1..100\n";
 
 $x = "abc\ndef\n";
 
@@ -328,3 +328,23 @@ print "not " if $blah != 45;
 print "ok $test\n";
 $test++;
 
+$x = 'banana';
+$x =~ /.a/g;
+print "not " unless pos($x) == 2;
+print "ok $test\n";
+$test++;
+
+$x =~ /.z/gc;
+print "not " unless pos($x) == 2;
+print "ok $test\n";
+$test++;
+
+sub f {
+    my $p = $_[0];
+    return $p;
+}
+
+$x =~ /.a/g;
+print "not " unless f(pos($x)) == 4;
+print "ok $test\n";
+$test++;