aboutsummaryrefslogtreecommitdiffstats
path: root/testing/perl-template-toolkit/split_pattern.patch
blob: b0b1152e48af45f806900838c34bf1fb220208c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
https://rt.cpan.org/Public/Bug/Display.html?id=84778

--- a/lib/Template/VMethods.pm	2012-02-07 09:06:38.000000000 +0000
+++ b/lib/Template/VMethods.pm	2013-04-22 16:58:34.000000000 +0000
@@ -261,12 +261,12 @@
 
     if (defined $limit) {
         return [ defined $split
-                 ? split($split, $str, $limit)
+                 ? split("(?:)".$split, $str, $limit)
                  : split(' ', $str, $limit) ];
     }
     else {
         return [ defined $split
-                 ? split($split, $str)
+                 ? split("(?:)".$split, $str)
                  : split(' ', $str) ];
     }
 }
--- a/lib/Template/Plugin/String.pm	2011-12-20 07:41:35.000000000 +0000
+++ b/lib/Template/Plugin/String.pm	2013-04-22 16:55:36.000000000 +0000
@@ -363,7 +363,7 @@
     my $split = CORE::shift;
     my $limit = CORE::shift || 0;
     $split = '\s+' unless defined $split;
-    return [ split($split, $self->{ text }, $limit) ];
+    return [ split("(?:)".$split, $self->{ text }, $limit) ];
 }