Skip to content

Commit

Permalink
IPv4 parser: handle the empty string
Browse files Browse the repository at this point in the history
This is a theoretical issue once #185 lands, but as discussed it seems
good to address this anyway. Fixes #79.
  • Loading branch information
annevk committed Jan 24, 2017
1 parent 3036255 commit cb146b9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,17 @@ runs these steps:

<li><p>Let <var>parts</var> be <var>input</var> split on "<code>.</code>".

<li><p>If the last item in <var>parts</var> is the empty string, set
<var>syntaxViolationFlag</var> and remove the last item from <var>parts</var>.
<li>
<p>If the last item in <var>parts</var> is the empty string, then:

<ol>
<li><p>Set <var>syntaxViolationFlag</var>.

<li><p>If <var>parts</var> has more than one item, then remove the last item from
<var>parts</var>.
<!-- Since the IPv4 parser is not to be invoked directly the input cannot be the empty string,
but if it somehow is this conditional makes sure we can keep going. -->
</ol>

<li><p>If <var>parts</var> has more than four items, return <var>input</var>.

Expand Down

0 comments on commit cb146b9

Please sign in to comment.