Subject: | Incorrect handling of multi-line obsolete entries |
Date: | Mon, 13 Oct 2008 17:56:49 +0400 |
To: | bug-Locale-PO [...] rt.cpan.org |
From: | Nikolai Kondrashov <Nikolai.Kondrashov [...] oktetlabs.ru> |
Hello.
Latest Locale::PO (0.21) handles multi-line obsolete entries incorrectly. It
puts "#~ " markers in the msgid/msgstr, which results in data corruption.
Below is a patch, which fixes it:
---:<---
--- a/PO.pm 2008-05-19 20:21:50.000000000 +0400
+++ b/PO.pm 2008-10-13 17:44:12.000000000 +0400
@@ -426,10 +426,10 @@
$buffer{msgstr_n}{$1} = $self->dequote($2);
$last_buffer = \$buffer{msgstr_n}{$1};
}
- elsif (/^(?:#~\s+)?"/) {
+ elsif (/^(?:#~\s+)?(".*)/) {
# contined string
- $$last_buffer .= $self->dequote($_);
+ $$last_buffer .= $self->dequote($1);
}
else {
warn "Strange line at $file line $line_number: $_\n";
--->:---
Thank you for a wonderful module :)! If only it was a bit faster :)
Sincerely,
Nick