r46390 - in /branches/upstream/libhtml-parser-perl/current: Changes META.yml Parser.pm Parser.xs README hparser.c hparser.h lib/HTML/Entities.pm t/uentities.t util.c

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Sun Oct 25 20:54:54 UTC 2009


Author: carnil-guest
Date: Sun Oct 25 20:54:46 2009
New Revision: 46390

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46390
Log:
[svn-upgrade] Integrating new upstream version, libhtml-parser-perl (3.64)

Modified:
    branches/upstream/libhtml-parser-perl/current/Changes
    branches/upstream/libhtml-parser-perl/current/META.yml
    branches/upstream/libhtml-parser-perl/current/Parser.pm
    branches/upstream/libhtml-parser-perl/current/Parser.xs
    branches/upstream/libhtml-parser-perl/current/README
    branches/upstream/libhtml-parser-perl/current/hparser.c
    branches/upstream/libhtml-parser-perl/current/hparser.h
    branches/upstream/libhtml-parser-perl/current/lib/HTML/Entities.pm
    branches/upstream/libhtml-parser-perl/current/t/uentities.t
    branches/upstream/libhtml-parser-perl/current/util.c

Modified: branches/upstream/libhtml-parser-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/Changes?rev=46390&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/Changes (original)
+++ branches/upstream/libhtml-parser-perl/current/Changes Sun Oct 25 20:54:46 2009
@@ -1,3 +1,15 @@
+_______________________________________________________________________________
+2009-10-25  Release 3.64
+
+Gisle Aas (5):
+      Convert files to UTF-8
+      Don't allow decode_entities() to generate illegal Unicode chars
+      Copyright 2009
+      Remove rendundant (repeated) test
+      Make parse_file() method use 3-arg open [RT#49434]
+
+
+
 _______________________________________________________________________________
 2009-10-22  Release 3.63
 

Modified: branches/upstream/libhtml-parser-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/META.yml?rev=46390&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/META.yml (original)
+++ branches/upstream/libhtml-parser-perl/current/META.yml Sun Oct 25 20:54:46 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               HTML-Parser
-version:            3.63
+version:            3.64
 abstract:           HTML parser class
 author:
     - Gisle Aas <gisle at activestate.com>

Modified: branches/upstream/libhtml-parser-perl/current/Parser.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/Parser.pm?rev=46390&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/Parser.pm (original)
+++ branches/upstream/libhtml-parser-perl/current/Parser.pm Sun Oct 25 20:54:46 2009
@@ -1,6 +1,6 @@
 package HTML::Parser;
 
-# Copyright 1996-2008, Gisle Aas.
+# Copyright 1996-2009, Gisle Aas.
 # Copyright 1999-2000, Michael A. Chase.
 #
 # This library is free software; you can redistribute it and/or
@@ -9,7 +9,7 @@
 use strict;
 use vars qw($VERSION @ISA);
 
-$VERSION = "3.63";
+$VERSION = "3.64";
 
 require HTML::Entities;
 
@@ -92,7 +92,7 @@
     if (!ref($file) && ref(\$file) ne "GLOB") {
         # Assume $file is a filename
         local(*F);
-        open(F, $file) || return undef;
+        open(F, "<", $file) || return undef;
 	binmode(F);  # should we? good for byte counts
         $opened++;
         $file = *F;

Modified: branches/upstream/libhtml-parser-perl/current/Parser.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/Parser.xs?rev=46390&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/Parser.xs (original)
+++ branches/upstream/libhtml-parser-perl/current/Parser.xs Sun Oct 25 20:54:46 2009
@@ -1,5 +1,5 @@
 /* 
- * Copyright 1999-2005, Gisle Aas.
+ * Copyright 1999-2009, Gisle Aas.
  * Copyright 1999-2000, Michael A. Chase.
  *
  * This library is free software; you can redistribute it and/or

Modified: branches/upstream/libhtml-parser-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/README?rev=46390&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/README (original)
+++ branches/upstream/libhtml-parser-perl/current/README Sun Oct 25 20:54:46 2009
@@ -58,8 +58,8 @@
 
 COPYRIGHT
 
-  © 1995-2008 Gisle Aas. All rights reserved.
-  © 1999-2000 Michael A. Chase.  All rights reserved.
+  © 1995-2009 Gisle Aas. All rights reserved.
+  © 1999-2000 Michael A. Chase.  All rights reserved.
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself.

Modified: branches/upstream/libhtml-parser-perl/current/hparser.c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/hparser.c?rev=46390&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/hparser.c (original)
+++ branches/upstream/libhtml-parser-perl/current/hparser.c Sun Oct 25 20:54:46 2009
@@ -1,5 +1,5 @@
 /* 
- * Copyright 1999-2008, Gisle Aas
+ * Copyright 1999-2009, Gisle Aas
  * Copyright 1999-2000, Michael A. Chase
  *
  * This library is free software; you can redistribute it and/or

Modified: branches/upstream/libhtml-parser-perl/current/hparser.h
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/hparser.h?rev=46390&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/hparser.h (original)
+++ branches/upstream/libhtml-parser-perl/current/hparser.h Sun Oct 25 20:54:46 2009
@@ -1,5 +1,5 @@
 /* 
- * Copyright 1999-2005, Gisle Aas
+ * Copyright 1999-2009, Gisle Aas
  * Copyright 1999-2000, Michael A. Chase
  *
  * This library is free software; you can redistribute it and/or

Modified: branches/upstream/libhtml-parser-perl/current/lib/HTML/Entities.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/lib/HTML/Entities.pm?rev=46390&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/lib/HTML/Entities.pm (original)
+++ branches/upstream/libhtml-parser-perl/current/lib/HTML/Entities.pm Sun Oct 25 20:54:46 2009
@@ -14,7 +14,7 @@
 
 For example, this:
 
- $input = "vis-à-vis Beyoncé's naïve\npapier-mâché résumé";
+ $input = "vis-à-vis Beyoncé's naïve\npapier-mâché résumé";
  print encode_entities($input), "\n"
 
 Prints this out:
@@ -68,7 +68,7 @@
 
    $string = "foo&nbspbar";
    _decode_entities($string, { nb => "@", nbsp => "\xA0" }, 1);
-   print $string;  # will print "foo bar"
+   print $string;  # will print "foo bar"
 
 This routine is exported by default.
 
@@ -146,7 +146,7 @@
 @EXPORT = qw(encode_entities decode_entities _decode_entities);
 @EXPORT_OK = qw(%entity2char %char2entity encode_entities_numeric);
 
-$VERSION = "3.63";
+$VERSION = "3.64";
 sub Version { $VERSION; }
 
 require HTML::Parser;  # for fast XS implemented decode_entities

Modified: branches/upstream/libhtml-parser-perl/current/t/uentities.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/t/uentities.t?rev=46390&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/t/uentities.t (original)
+++ branches/upstream/libhtml-parser-perl/current/t/uentities.t Sun Oct 25 20:54:46 2009
@@ -2,7 +2,7 @@
 
 use HTML::Entities;
 
-use Test::More tests => 27;
+use Test::More tests => 26;
 
 SKIP: {
 skip "This perl does not support Unicode or Unicode entities not selected",
@@ -25,15 +25,15 @@
 is(decode_entities("&#xFDD1"), "\x{FFFD}");
 is(decode_entities("&#xFDE0"), "\x{FFFD}");
 is(decode_entities("&#xFDEF"), "\x{FFFD}");
-is(decode_entities("&#xFFFF"), "\x{FFFD}");
+is(decode_entities("&#xFFFF"), "&#xFFFF");
 is(decode_entities("&#x10FFFF"), "\x{FFFD}");
-is(decode_entities("&#x110000"), chr(0xFFFD));
-is(decode_entities("&#XFFFFFFFF"), chr(0xFFFD));
+is(decode_entities("&#x110000"), "&#x110000");
+is(decode_entities("&#XFFFFFFFF"), "&#XFFFFFFFF");
 
-is(decode_entities("&#0"), "\0");
-is(decode_entities("&#0;"), "\0");
-is(decode_entities("&#x0"), "\0");
-is(decode_entities("&#X0;"), "\0");
+is(decode_entities("&#0"), "&#0");
+is(decode_entities("&#0;"), "&#0;");
+is(decode_entities("&#x0"), "&#x0");
+is(decode_entities("&#X0;"), "&#X0;");
 
 is(decode_entities("&#&aring&#229&#229;&#xFFF"), "&#ååå\x{FFF}");
 
@@ -59,8 +59,6 @@
 
 is(decode_entities("&#56256;&#56453;"), chr(0x100085));
 
-is(decode_entities("&#56256;&#56453;"), chr(0x100085));
-
 is(decode_entities("&#56256"), chr(0xFFFD));
 
 is(decode_entities("\260&rsquo;\260"), "\x{b0}\x{2019}\x{b0}");

Modified: branches/upstream/libhtml-parser-perl/current/util.c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-parser-perl/current/util.c?rev=46390&op=diff
==============================================================================
--- branches/upstream/libhtml-parser-perl/current/util.c (original)
+++ branches/upstream/libhtml-parser-perl/current/util.c Sun Oct 25 20:54:46 2009
@@ -1,5 +1,5 @@
 /* 
- * Copyright 1999-2006, Gisle Aas.
+ * Copyright 1999-2009, Gisle Aas.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the same terms as Perl itself.
@@ -96,7 +96,6 @@
 
 	if (s < end && *s == '#') {
 	    UV num = 0;
-	    UV prev = 0;
 	    int ok = 0;
 	    s++;
 	    if (s < end && (*s == 'x' || *s == 'X')) {
@@ -106,12 +105,11 @@
 		    if (!tmp)
 			break;
 		    num = num << 4 | ((tmp - PL_hexdigit) & 15);
-		    if (prev && num <= prev) {
+		    if (num > 0x10FFFF) {
 			/* overflow */
 			ok = 0;
 			break;
 		    }
-		    prev = num;
 		    s++;
 		    ok = 1;
 		}
@@ -119,23 +117,25 @@
 	    else {
 		while (s < end && isDIGIT(*s)) {
 		    num = num * 10 + (*s - '0');
-		    if (prev && num < prev) {
+		    if (num > 0x10FFFF) {
 			/* overflow */
 			ok = 0;
 			break;
 		    }
-		    prev = num;
 		    s++;
 		    ok = 1;
 		}
 	    }
-	    if (ok) {
+	    if (num && ok) {
 #ifdef UNICODE_HTML_PARSER
 		if (!SvUTF8(sv) && num <= 255) {
 		    buf[0] = (char) num;
 		    repl = buf;
 		    repl_len = 1;
 		    repl_utf8 = 0;
+		}
+		else if (num == 0xFFFE || num == 0xFFFF) {
+		    /* illegal */
 		}
 		else {
 		    char *tmp;




More information about the Pkg-perl-cvs-commits mailing list