From: Niko Tyni <ntyni@iki.fi>
Date: Sun, 4 Nov 2007 20:46:58 +0200
Subject: Fix charset decoding in the PurePerl module (#405186)

---
 lib/XML/SAX/PurePerl.pm             | 2 +-
 lib/XML/SAX/PurePerl/Productions.pm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/XML/SAX/PurePerl.pm b/lib/XML/SAX/PurePerl.pm
index 7940736..21ad55e 100644
--- a/lib/XML/SAX/PurePerl.pm
+++ b/lib/XML/SAX/PurePerl.pm
@@ -677,7 +677,7 @@ sub Name {
     
     return unless length($name);
     
-    $name =~ /$NameChar/o or $self->parser_error("Name <$name> does not match NameChar production", $reader);
+    $name =~ /^$NameChar+$/o or $self->parser_error("Name <$name> does not match NameChar production", $reader);
 
     return $name;
 }
diff --git a/lib/XML/SAX/PurePerl/Productions.pm b/lib/XML/SAX/PurePerl/Productions.pm
index 25d49fb..49911ba 100644
--- a/lib/XML/SAX/PurePerl/Productions.pm
+++ b/lib/XML/SAX/PurePerl/Productions.pm
@@ -39,7 +39,7 @@ if ($] < 5.006) {
     # can't do this one without unicode
     # $CombiningChar = qr/^$/msx;
     
-    $NameChar = qr/^ (?: $BaseChar | $Digit | [._:-] | $Extender )+ $/x;
+    $NameChar = qr/ (?: $BaseChar | $Digit | [._:-] | $Extender )+ /x;
     PERL
     die $@ if $@;
 }
