<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21175</bug_id>
          
          <creation_ts>2013-03-03 00:59:32 +0000</creation_ts>
          <short_desc>&quot;Last string&quot; of path is undefined if path has no strings while a URL is parsed</short_desc>
          <delta_ts>2013-03-04 09:45:38 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>URL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Peter Occil">poccil</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
          
          <qa_contact>sideshowbarker+urlspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>83905</commentid>
    <comment_count>0</comment_count>
    <who name="Peter Occil">poccil</who>
    <bug_when>2013-03-03 00:59:32 +0000</bug_when>
    <thetext>From the parsing algorithm:
----
If buffer is &quot;..&quot; and c is one of EOF code point, &quot;/&quot;, and &quot;\&quot;, set the last string in url&apos;s path to the empty string.

Otherwise, if buffer is &quot;..&quot;, remove the last string from url&apos;s path.
----

For URLs like:  

http://example.com/../../filename  ,

when there are no strings in the path yet, after the first &quot;../&quot; is read,
it&apos;s undefined what happens. Does it trigger an error?  
Does the parser return failure?  Or is that step just simply ignored? 

This may also affect this rule, found elsewhere in the algorithm:
-----

Set url&apos;s host to base&apos;s host, url&apos;s port to base&apos;s port, url&apos;s path to base&apos;s path, then remove url&apos;s path&apos;s last string, set state to relative path state, and decrease pointer by one.
-----</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83910</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-03-03 13:17:37 +0000</bug_when>
    <thetext>Yeah, I suppose this should all just become pop url&apos;s path and append to url&apos;s path, with replace being that combination.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83911</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-03-03 13:26:40 +0000</bug_when>
    <thetext>https://github.com/whatwg/url/commit/33b15c97d762e9f100126f66e2bec4234a3779df</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83913</commentid>
    <comment_count>3</comment_count>
    <who name="Peter Occil">poccil</who>
    <bug_when>2013-03-03 15:05:07 +0000</bug_when>
    <thetext>Thanks for your change.  I think having it say &quot;pop url&apos;s path if possible&quot; would make it better, to further make it clear.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83925</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-03-04 09:45:38 +0000</bug_when>
    <thetext>Fair enough: https://github.com/whatwg/url/commit/a421bbc781d923e6cfb84f10bc5c21cd4a164882</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>