[Po4a-commits] "po4a/lib/Locale/Po4a Xml.pm,1.43,1.44"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Wed Apr 12 22:33:12 UTC 2006


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv31640/lib/Locale/Po4a

Modified Files:
	Xml.pm 
Log Message:
Make sure get_string_until works when the serach string (or regex)
contains a newline (\n).


Index: Xml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- Xml.pm	12 Apr 2006 20:43:48 -0000	1.43
+++ Xml.pm	12 Apr 2006 22:33:09 -0000	1.44
@@ -1303,13 +1303,13 @@
 	if ( $found ) {
 		$line = "";
 		if($unquoted) {
-			$text[$#text-1] =~ /^(((\".*?\")|(\'.*?\')|[^\"\'])*?$search)(.*)/s;
-			$text[$#text-1] = $1;
-			$line = $5;
+			$paragraph =~ /^(?:(?:\".*?\")|(?:\'.*?\')|[^\"\'])*?$search(.*)$/s;
+			$line = $1;
+			$text[$#text-1] =~ s/\Q$line\E$//s;
 		} else {
-			$text[$#text-1] =~ /(.*?$search)(.*)/s;
-			$text[$#text-1] = $1;
-			$line = $2;
+			$paragraph =~ /$search(.*)$/s;
+			$line = $1;
+			$text[$#text-1] =~ s/\Q$line\E$//s;
 		}
 		if(!$include) {
 			$text[$#text-1] =~ /(.*)($search.*)/s;




More information about the Po4a-commits mailing list