nokogiri 1.11.3 → 1.13.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/LICENSE-DEPENDENCIES.md +243 -22
  4. data/LICENSE.md +1 -1
  5. data/README.md +14 -11
  6. data/bin/nokogiri +63 -50
  7. data/dependencies.yml +13 -64
  8. data/ext/nokogiri/depend +35 -34
  9. data/ext/nokogiri/extconf.rb +237 -133
  10. data/ext/nokogiri/gumbo.c +584 -0
  11. data/ext/nokogiri/{html_document.c → html4_document.c} +8 -8
  12. data/ext/nokogiri/{html_element_description.c → html4_element_description.c} +21 -19
  13. data/ext/nokogiri/{html_entity_lookup.c → html4_entity_lookup.c} +7 -7
  14. data/ext/nokogiri/{html_sax_parser_context.c → html4_sax_parser_context.c} +8 -8
  15. data/ext/nokogiri/{html_sax_push_parser.c → html4_sax_push_parser.c} +4 -4
  16. data/ext/nokogiri/libxml2_backwards_compat.c +30 -30
  17. data/ext/nokogiri/nokogiri.c +70 -38
  18. data/ext/nokogiri/nokogiri.h +27 -9
  19. data/ext/nokogiri/xml_attr.c +2 -2
  20. data/ext/nokogiri/xml_attribute_decl.c +3 -3
  21. data/ext/nokogiri/xml_cdata.c +1 -1
  22. data/ext/nokogiri/xml_document.c +50 -50
  23. data/ext/nokogiri/xml_document_fragment.c +0 -2
  24. data/ext/nokogiri/xml_dtd.c +10 -10
  25. data/ext/nokogiri/xml_element_content.c +2 -0
  26. data/ext/nokogiri/xml_element_decl.c +3 -3
  27. data/ext/nokogiri/xml_encoding_handler.c +31 -12
  28. data/ext/nokogiri/xml_entity_decl.c +5 -5
  29. data/ext/nokogiri/xml_namespace.c +4 -2
  30. data/ext/nokogiri/xml_node.c +833 -492
  31. data/ext/nokogiri/xml_node_set.c +24 -24
  32. data/ext/nokogiri/xml_reader.c +90 -11
  33. data/ext/nokogiri/xml_sax_parser.c +6 -6
  34. data/ext/nokogiri/xml_sax_parser_context.c +12 -3
  35. data/ext/nokogiri/xml_schema.c +5 -3
  36. data/ext/nokogiri/xml_text.c +1 -1
  37. data/ext/nokogiri/xml_xpath_context.c +110 -85
  38. data/ext/nokogiri/xslt_stylesheet.c +109 -10
  39. data/gumbo-parser/CHANGES.md +63 -0
  40. data/gumbo-parser/Makefile +101 -0
  41. data/gumbo-parser/THANKS +27 -0
  42. data/gumbo-parser/src/Makefile +34 -0
  43. data/gumbo-parser/src/README.md +41 -0
  44. data/gumbo-parser/src/ascii.c +75 -0
  45. data/gumbo-parser/src/ascii.h +115 -0
  46. data/gumbo-parser/src/attribute.c +42 -0
  47. data/gumbo-parser/src/attribute.h +17 -0
  48. data/gumbo-parser/src/char_ref.c +22225 -0
  49. data/gumbo-parser/src/char_ref.h +29 -0
  50. data/gumbo-parser/src/char_ref.rl +2154 -0
  51. data/gumbo-parser/src/error.c +626 -0
  52. data/gumbo-parser/src/error.h +148 -0
  53. data/gumbo-parser/src/foreign_attrs.c +104 -0
  54. data/gumbo-parser/src/foreign_attrs.gperf +27 -0
  55. data/gumbo-parser/src/gumbo.h +943 -0
  56. data/gumbo-parser/src/insertion_mode.h +33 -0
  57. data/gumbo-parser/src/macros.h +91 -0
  58. data/gumbo-parser/src/parser.c +4875 -0
  59. data/gumbo-parser/src/parser.h +41 -0
  60. data/gumbo-parser/src/replacement.h +33 -0
  61. data/gumbo-parser/src/string_buffer.c +103 -0
  62. data/gumbo-parser/src/string_buffer.h +68 -0
  63. data/gumbo-parser/src/string_piece.c +48 -0
  64. data/gumbo-parser/src/svg_attrs.c +174 -0
  65. data/gumbo-parser/src/svg_attrs.gperf +77 -0
  66. data/gumbo-parser/src/svg_tags.c +137 -0
  67. data/gumbo-parser/src/svg_tags.gperf +55 -0
  68. data/gumbo-parser/src/tag.c +222 -0
  69. data/gumbo-parser/src/tag_lookup.c +382 -0
  70. data/gumbo-parser/src/tag_lookup.gperf +169 -0
  71. data/gumbo-parser/src/tag_lookup.h +13 -0
  72. data/gumbo-parser/src/token_buffer.c +79 -0
  73. data/gumbo-parser/src/token_buffer.h +71 -0
  74. data/gumbo-parser/src/token_type.h +17 -0
  75. data/gumbo-parser/src/tokenizer.c +3463 -0
  76. data/gumbo-parser/src/tokenizer.h +112 -0
  77. data/gumbo-parser/src/tokenizer_states.h +339 -0
  78. data/gumbo-parser/src/utf8.c +245 -0
  79. data/gumbo-parser/src/utf8.h +164 -0
  80. data/gumbo-parser/src/util.c +68 -0
  81. data/gumbo-parser/src/util.h +30 -0
  82. data/gumbo-parser/src/vector.c +111 -0
  83. data/gumbo-parser/src/vector.h +45 -0
  84. data/lib/nokogiri/class_resolver.rb +67 -0
  85. data/lib/nokogiri/css/node.rb +9 -8
  86. data/lib/nokogiri/css/parser.rb +361 -342
  87. data/lib/nokogiri/css/parser.y +250 -245
  88. data/lib/nokogiri/css/parser_extras.rb +22 -20
  89. data/lib/nokogiri/css/syntax_error.rb +2 -1
  90. data/lib/nokogiri/css/tokenizer.rb +4 -3
  91. data/lib/nokogiri/css/tokenizer.rex +3 -2
  92. data/lib/nokogiri/css/xpath_visitor.rb +179 -82
  93. data/lib/nokogiri/css.rb +49 -17
  94. data/lib/nokogiri/decorators/slop.rb +8 -7
  95. data/lib/nokogiri/extension.rb +8 -3
  96. data/lib/nokogiri/gumbo.rb +15 -0
  97. data/lib/nokogiri/html.rb +37 -27
  98. data/lib/nokogiri/{html → html4}/builder.rb +3 -2
  99. data/lib/nokogiri/{html → html4}/document.rb +92 -81
  100. data/lib/nokogiri/{html → html4}/document_fragment.rb +13 -9
  101. data/lib/nokogiri/{html → html4}/element_description.rb +2 -1
  102. data/lib/nokogiri/html4/element_description_defaults.rb +578 -0
  103. data/lib/nokogiri/{html → html4}/entity_lookup.rb +3 -2
  104. data/lib/nokogiri/{html → html4}/sax/parser.rb +16 -16
  105. data/lib/nokogiri/html4/sax/parser_context.rb +20 -0
  106. data/lib/nokogiri/{html → html4}/sax/push_parser.rb +11 -11
  107. data/lib/nokogiri/html4.rb +46 -0
  108. data/lib/nokogiri/html5/document.rb +91 -0
  109. data/lib/nokogiri/html5/document_fragment.rb +83 -0
  110. data/lib/nokogiri/html5/node.rb +100 -0
  111. data/lib/nokogiri/html5.rb +478 -0
  112. data/lib/nokogiri/jruby/dependencies.rb +10 -9
  113. data/lib/nokogiri/syntax_error.rb +1 -0
  114. data/lib/nokogiri/version/constant.rb +2 -1
  115. data/lib/nokogiri/version/info.rb +31 -14
  116. data/lib/nokogiri/version.rb +1 -0
  117. data/lib/nokogiri/xml/attr.rb +5 -3
  118. data/lib/nokogiri/xml/attribute_decl.rb +2 -1
  119. data/lib/nokogiri/xml/builder.rb +71 -31
  120. data/lib/nokogiri/xml/cdata.rb +2 -1
  121. data/lib/nokogiri/xml/character_data.rb +1 -0
  122. data/lib/nokogiri/xml/document.rb +183 -96
  123. data/lib/nokogiri/xml/document_fragment.rb +41 -38
  124. data/lib/nokogiri/xml/dtd.rb +3 -2
  125. data/lib/nokogiri/xml/element_content.rb +1 -0
  126. data/lib/nokogiri/xml/element_decl.rb +2 -1
  127. data/lib/nokogiri/xml/entity_decl.rb +3 -2
  128. data/lib/nokogiri/xml/entity_reference.rb +1 -0
  129. data/lib/nokogiri/xml/namespace.rb +2 -0
  130. data/lib/nokogiri/xml/node/save_options.rb +9 -5
  131. data/lib/nokogiri/xml/node.rb +525 -354
  132. data/lib/nokogiri/xml/node_set.rb +50 -54
  133. data/lib/nokogiri/xml/notation.rb +12 -0
  134. data/lib/nokogiri/xml/parse_options.rb +13 -6
  135. data/lib/nokogiri/xml/pp/character_data.rb +8 -6
  136. data/lib/nokogiri/xml/pp/node.rb +24 -26
  137. data/lib/nokogiri/xml/pp.rb +3 -2
  138. data/lib/nokogiri/xml/processing_instruction.rb +2 -1
  139. data/lib/nokogiri/xml/reader.rb +20 -24
  140. data/lib/nokogiri/xml/relax_ng.rb +1 -0
  141. data/lib/nokogiri/xml/sax/document.rb +44 -49
  142. data/lib/nokogiri/xml/sax/parser.rb +37 -34
  143. data/lib/nokogiri/xml/sax/parser_context.rb +7 -3
  144. data/lib/nokogiri/xml/sax/push_parser.rb +5 -5
  145. data/lib/nokogiri/xml/sax.rb +5 -4
  146. data/lib/nokogiri/xml/schema.rb +7 -6
  147. data/lib/nokogiri/xml/searchable.rb +93 -62
  148. data/lib/nokogiri/xml/syntax_error.rb +5 -4
  149. data/lib/nokogiri/xml/text.rb +1 -0
  150. data/lib/nokogiri/xml/xpath/syntax_error.rb +2 -1
  151. data/lib/nokogiri/xml/xpath.rb +13 -1
  152. data/lib/nokogiri/xml/xpath_context.rb +2 -3
  153. data/lib/nokogiri/xml.rb +37 -37
  154. data/lib/nokogiri/xslt/stylesheet.rb +2 -1
  155. data/lib/nokogiri/xslt.rb +28 -20
  156. data/lib/nokogiri.rb +48 -43
  157. data/lib/xsd/xmlparser/nokogiri.rb +25 -24
  158. data/patches/libxml2/{0002-Remove-script-macro-support.patch → 0001-Remove-script-macro-support.patch} +0 -0
  159. data/patches/libxml2/{0003-Update-entities-to-remove-handling-of-ssi.patch → 0002-Update-entities-to-remove-handling-of-ssi.patch} +0 -0
  160. data/patches/libxml2/{0004-libxml2.la-is-in-top_builddir.patch → 0003-libxml2.la-is-in-top_builddir.patch} +1 -1
  161. data/patches/libxml2/{0008-use-glibc-strlen.patch → 0004-use-glibc-strlen.patch} +3 -3
  162. data/patches/libxml2/{0009-avoid-isnan-isinf.patch → 0005-avoid-isnan-isinf.patch} +4 -4
  163. data/patches/libxml2/0006-update-automake-files-for-arm64.patch +3040 -0
  164. data/patches/libxml2/0008-htmlParseComment-handle-abruptly-closed-comments.patch +61 -0
  165. data/patches/libxml2/0009-allow-wildcard-namespaces.patch +77 -0
  166. data/patches/libxslt/0001-update-automake-files-for-arm64.patch +2445 -1919
  167. data/ports/archives/libxml2-2.9.14.tar.xz +0 -0
  168. data/ports/archives/libxslt-1.1.35.tar.xz +0 -0
  169. metadata +204 -93
  170. data/lib/nokogiri/html/element_description_defaults.rb +0 -672
  171. data/lib/nokogiri/html/sax/parser_context.rb +0 -17
  172. data/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch +0 -78
  173. data/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch +0 -32
  174. data/patches/libxml2/0006-htmlParseComment-treat-as-if-it-closed-the-comment.patch +0 -73
  175. data/patches/libxml2/0007-use-new-htmlParseLookupCommentEnd-to-find-comment-en.patch +0 -103
  176. data/patches/libxml2/0010-parser.c-shrink-the-input-buffer-when-appropriate.patch +0 -70
  177. data/patches/libxml2/0011-update-automake-files-for-arm64.patch +0 -2511
  178. data/ports/archives/libxml2-2.9.10.tar.gz +0 -0
  179. data/ports/archives/libxslt-1.1.34.tar.gz +0 -0
data/lib/nokogiri.rb CHANGED
@@ -1,75 +1,67 @@
1
- # -*- coding: utf-8 -*-
1
+ # coding: utf-8
2
2
  # frozen_string_literal: true
3
- # Modify the PATH on windows so that the external DLLs will get loaded.
4
3
 
5
- require 'rbconfig'
4
+ require "rbconfig"
6
5
 
7
6
  if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
8
- require 'nokogiri/jruby/dependencies'
7
+ require_relative "nokogiri/jruby/dependencies"
9
8
  end
10
9
 
11
- require 'nokogiri/extension'
12
-
13
- require 'nokogiri/version'
14
- require 'nokogiri/syntax_error'
15
- require 'nokogiri/xml'
16
- require 'nokogiri/xslt'
17
- require 'nokogiri/html'
18
- require 'nokogiri/decorators/slop'
19
- require 'nokogiri/css'
20
- require 'nokogiri/html/builder'
10
+ require_relative "nokogiri/extension"
21
11
 
22
12
  # Nokogiri parses and searches XML/HTML very quickly, and also has
23
13
  # correctly implemented CSS3 selector support as well as XPath 1.0
24
14
  # support.
25
15
  #
26
16
  # Parsing a document returns either a Nokogiri::XML::Document, or a
27
- # Nokogiri::HTML::Document depending on the kind of document you parse.
17
+ # Nokogiri::HTML4::Document depending on the kind of document you parse.
28
18
  #
29
19
  # Here is an example:
30
20
  #
31
- # require 'nokogiri'
32
- # require 'open-uri'
21
+ # require 'nokogiri'
22
+ # require 'open-uri'
23
+ #
24
+ # # Get a Nokogiri::HTML4::Document for the page we’re interested in...
33
25
  #
34
- # # Get a Nokogiri::HTML:Document for the page we’re interested in...
26
+ # doc = Nokogiri::HTML4(URI.open('http://www.google.com/search?q=tenderlove'))
35
27
  #
36
- # doc = Nokogiri::HTML(URI.open('http://www.google.com/search?q=tenderlove'))
28
+ # # Do funky things with it using Nokogiri::XML::Node methods...
37
29
  #
38
- # # Do funky things with it using Nokogiri::XML::Node methods...
30
+ # ####
31
+ # # Search for nodes by css
32
+ # doc.css('h3.r a.l').each do |link|
33
+ # puts link.content
34
+ # end
39
35
  #
40
- # ####
41
- # # Search for nodes by css
42
- # doc.css('h3.r a.l').each do |link|
43
- # puts link.content
44
- # end
36
+ # See also:
45
37
  #
46
- # See Nokogiri::XML::Searchable#css for more information about CSS searching.
47
- # See Nokogiri::XML::Searchable#xpath for more information about XPath searching.
38
+ # - Nokogiri::XML::Searchable#css for more information about CSS searching
39
+ # - Nokogiri::XML::Searchable#xpath for more information about XPath searching
48
40
  module Nokogiri
49
41
  class << self
50
42
  ###
51
43
  # Parse an HTML or XML document. +string+ contains the document.
52
- def parse string, url = nil, encoding = nil, options = nil
44
+ def parse(string, url = nil, encoding = nil, options = nil)
53
45
  if string.respond_to?(:read) ||
54
- /^\s*<(?:!DOCTYPE\s+)?html[\s>]/i === string[0, 512]
46
+ /^\s*<(?:!DOCTYPE\s+)?html[\s>]/i.match?(string[0, 512])
55
47
  # Expect an HTML indicator to appear within the first 512
56
48
  # characters of a document. (<?xml ?> + <?xml-stylesheet ?>
57
49
  # shouldn't be that long)
58
- Nokogiri.HTML(string, url, encoding,
50
+ Nokogiri.HTML4(string, url, encoding,
59
51
  options || XML::ParseOptions::DEFAULT_HTML)
60
52
  else
61
53
  Nokogiri.XML(string, url, encoding,
62
54
  options || XML::ParseOptions::DEFAULT_XML)
63
- end.tap { |doc|
55
+ end.tap do |doc|
64
56
  yield doc if block_given?
65
- }
57
+ end
66
58
  end
67
59
 
68
60
  ###
69
61
  # Create a new Nokogiri::XML::DocumentFragment
70
- def make input = nil, opts = {}, &blk
62
+ def make(input = nil, opts = {}, &blk)
71
63
  if input
72
- Nokogiri::HTML.fragment(input).children.first
64
+ Nokogiri::HTML4.fragment(input).children.first
73
65
  else
74
66
  Nokogiri(&blk)
75
67
  end
@@ -94,14 +86,15 @@ module Nokogiri
94
86
  Nokogiri(*args, &block).slop!
95
87
  end
96
88
 
89
+ # :nodoc:
97
90
  def install_default_aliases
98
91
  # Make sure to support some popular encoding aliases not known by
99
92
  # all iconv implementations.
100
93
  {
101
- 'Windows-31J' => 'CP932', # Windows-31J is the IANA registered name of CP932.
102
- }.each { |alias_name, name|
94
+ "Windows-31J" => "CP932", # Windows-31J is the IANA registered name of CP932.
95
+ }.each do |alias_name, name|
103
96
  EncodingHandler.alias(name, alias_name) if EncodingHandler[alias_name].nil?
104
- }
97
+ end
105
98
  end
106
99
  end
107
100
 
@@ -109,15 +102,27 @@ module Nokogiri
109
102
  end
110
103
 
111
104
  ###
112
- # Parse a document contained in +args+. Nokogiri will try to guess what
113
- # type of document you are attempting to parse. For more information, see
114
- # Nokogiri.parse
105
+ # Parse a document contained in +args+. Nokogiri will try to guess what type of document you are
106
+ # attempting to parse. For more information, see Nokogiri.parse
115
107
  #
116
- # To specify the type of document, use Nokogiri.XML or Nokogiri.HTML.
108
+ # To specify the type of document, use {Nokogiri.XML}, {Nokogiri.HTML4}, or {Nokogiri.HTML5}.
117
109
  def Nokogiri(*args, &block)
118
- if block_given?
119
- Nokogiri::HTML::Builder.new(&block).doc.root
110
+ if block
111
+ Nokogiri::HTML4::Builder.new(&block).doc.root
120
112
  else
121
113
  Nokogiri.parse(*args)
122
114
  end
123
115
  end
116
+
117
+ require_relative "nokogiri/version"
118
+ require_relative "nokogiri/class_resolver"
119
+ require_relative "nokogiri/syntax_error"
120
+ require_relative "nokogiri/xml"
121
+ require_relative "nokogiri/xslt"
122
+ require_relative "nokogiri/html4"
123
+ require_relative "nokogiri/html"
124
+ require_relative "nokogiri/decorators/slop"
125
+ require_relative "nokogiri/css"
126
+ require_relative "nokogiri/html4/builder"
127
+
128
+ require_relative "nokogiri/html5" if Nokogiri.uses_gumbo?
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
- require 'nokogiri'
3
2
 
4
- module XSD # :nodoc:
5
- module XMLParser # :nodoc:
3
+ require "nokogiri"
4
+
5
+ module XSD
6
+ module XMLParser
6
7
  ###
7
8
  # Nokogiri XML parser for soap4r.
8
9
  #
@@ -27,40 +28,40 @@ module XSD # :nodoc:
27
28
  class Nokogiri < XSD::XMLParser::Parser
28
29
  ###
29
30
  # Create a new XSD parser with +host+ and +opt+
30
- def initialize host, opt = {}
31
+ def initialize(host, opt = {})
31
32
  super
32
- @parser = ::Nokogiri::XML::SAX::Parser.new(self, @charset || 'UTF-8')
33
+ @parser = ::Nokogiri::XML::SAX::Parser.new(self, @charset || "UTF-8")
33
34
  end
34
35
 
35
36
  ###
36
37
  # Start parsing +string_or_readable+
37
- def do_parse string_or_readable
38
+ def do_parse(string_or_readable)
38
39
  @parser.parse(string_or_readable)
39
40
  end
40
41
 
41
42
  ###
42
43
  # Handle the start_element event with +name+ and +attrs+
43
- def start_element name, attrs = []
44
+ def start_element(name, attrs = [])
44
45
  super(name, Hash[*attrs.flatten])
45
46
  end
46
47
 
47
48
  ###
48
49
  # Handle the end_element event with +name+
49
- def end_element name
50
+ def end_element(name)
50
51
  super
51
52
  end
52
53
 
53
54
  ###
54
55
  # Handle errors with message +msg+
55
- def error msg
56
- raise ParseError.new(msg)
56
+ def error(msg)
57
+ raise ParseError, msg
57
58
  end
58
- alias :warning :error
59
+ alias_method :warning, :error
59
60
 
60
61
  ###
61
62
  # Handle cdata_blocks containing +string+
62
- def cdata_block string
63
- characters string
63
+ def cdata_block(string)
64
+ characters(string)
64
65
  end
65
66
 
66
67
  ###
@@ -70,16 +71,16 @@ module XSD # :nodoc:
70
71
  # +prefix+ is the namespace prefix for the element
71
72
  # +uri+ is the associated namespace URI
72
73
  # +ns+ is a hash of namespace prefix:urls associated with the element
73
- def start_element_namespace name, attrs = [], prefix = nil, uri = nil, ns = []
74
+ def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = [])
74
75
  ###
75
76
  # Deal with SAX v1 interface
76
- name = [prefix, name].compact.join(':')
77
- attributes = ns.map { |ns_prefix,ns_uri|
78
- [['xmlns', ns_prefix].compact.join(':'), ns_uri]
79
- } + attrs.map { |attr|
80
- [[attr.prefix, attr.localname].compact.join(':'), attr.value]
81
- }.flatten
82
- start_element name, attributes
77
+ name = [prefix, name].compact.join(":")
78
+ attributes = ns.map do |ns_prefix, ns_uri|
79
+ [["xmlns", ns_prefix].compact.join(":"), ns_uri]
80
+ end + attrs.map do |attr|
81
+ [[attr.prefix, attr.localname].compact.join(":"), attr.value]
82
+ end.flatten
83
+ start_element(name, attributes)
83
84
  end
84
85
 
85
86
  ###
@@ -87,13 +88,13 @@ module XSD # :nodoc:
87
88
  # +name+ is the element's name
88
89
  # +prefix+ is the namespace prefix associated with the element
89
90
  # +uri+ is the associated namespace URI
90
- def end_element_namespace name, prefix = nil, uri = nil
91
+ def end_element_namespace(name, prefix = nil, uri = nil)
91
92
  ###
92
93
  # Deal with SAX v1 interface
93
- end_element [prefix, name].compact.join(':')
94
+ end_element([prefix, name].compact.join(":"))
94
95
  end
95
96
 
96
- %w{ xmldecl start_document end_document comment }.each do |name|
97
+ ["xmldecl", "start_document", "end_document", "comment"].each do |name|
97
98
  class_eval %{ def #{name}(*args); end }
98
99
  end
99
100
 
@@ -16,7 +16,7 @@ index cf96d41..1372d8b 100644
16
16
  }
17
17
 
18
18
  -libxml2.la: $(libxml2_la_OBJECTS) $(libxml2_la_DEPENDENCIES) $(EXTRA_libxml2_la_DEPENDENCIES)
19
- +$(top_builddir)/libxml2.la: $(libxml2_la_OBJECTS) $(libxml2_la_DEPENDENCIES) $(EXTRA_libxml2_la_DEPENDENCIES)
19
+ +$(top_builddir)/libxml2.la: $(libxml2_la_OBJECTS) $(libxml2_la_DEPENDENCIES) $(EXTRA_libxml2_la_DEPENDENCIES)
20
20
  $(AM_V_CCLD)$(libxml2_la_LINK) -rpath $(libdir) $(libxml2_la_OBJECTS) $(libxml2_la_LIBADD) $(LIBS)
21
21
 
22
22
  testdso.la: $(testdso_la_OBJECTS) $(testdso_la_DEPENDENCIES) $(EXTRA_testdso_la_DEPENDENCIES)
@@ -31,18 +31,18 @@ diff --git a/xmlstring.c b/xmlstring.c
31
31
  index e8a1e45d..df247dff 100644
32
32
  --- a/xmlstring.c
33
33
  +++ b/xmlstring.c
34
- @@ -423,14 +423,9 @@ xmlStrsub(const xmlChar *str, int start, int len) {
34
+ @@ -423,12 +423,7 @@ xmlStrsub(const xmlChar *str, int start, int len) {
35
35
 
36
36
  int
37
37
  xmlStrlen(const xmlChar *str) {
38
- - int len = 0;
38
+ - size_t len = 0;
39
39
  -
40
40
  if (str == NULL) return(0);
41
41
  - while (*str != 0) { /* non input consuming */
42
42
  - str++;
43
43
  - len++;
44
44
  - }
45
- - return(len);
45
+ - return(len > INT_MAX ? 0 : len);
46
46
  +
47
47
  + return strlen((const char*)str);
48
48
  }
@@ -51,7 +51,7 @@ diff --git a/xpath.c b/xpath.c
51
51
  index 9f64ab9..5b6d999 100644
52
52
  --- a/xpath.c
53
53
  +++ b/xpath.c
54
- @@ -509,11 +509,7 @@ xmlXPathInit(void) {
54
+ @@ -515,11 +515,7 @@ xmlXPathInit(void) {
55
55
  */
56
56
  int
57
57
  xmlXPathIsNaN(double val) {
@@ -63,16 +63,16 @@ index 9f64ab9..5b6d999 100644
63
63
  }
64
64
 
65
65
  /**
66
- @@ -524,15 +520,11 @@ xmlXPathIsNaN(double val) {
66
+ @@ -530,15 +530,11 @@ xmlXPathIsNaN(double val) {
67
67
  */
68
68
  int
69
69
  xmlXPathIsInf(double val) {
70
70
  -#ifdef isinf
71
71
  - return isinf(val) ? (val > 0 ? 1 : -1) : 0;
72
72
  -#else
73
- if (val >= INFINITY)
73
+ if (val >= xmlXPathPINF)
74
74
  return 1;
75
- if (val <= -INFINITY)
75
+ if (val <= -xmlXPathPINF)
76
76
  return -1;
77
77
  return 0;
78
78
  -#endif