pike.git / lib / modules / Standards.pmod / URI.pike

version» Context lines:

pike.git/lib/modules/Standards.pmod/URI.pike:204:    // within the URI reference and not inherited from the base URI.    // (Doing this at once saves us some useless parsing efforts.)    if((!uri || uri == "") && this_program::base_uri)    {    DEBUG("Path is empty -- Inherit entire base URI "    "as per RFC 2396, §5.2 step 2. Done!");    inherit_properties(this_program::base_uri);    return;    }    -  if(has_prefix (uri, "#") && this_program::base_uri) +  // Parse fragment identifier +  // fragment = *( pchar / "/" / "?" ) +  // pchar = unreserved / pct-encoded / sub-delims / ":" / "@" +  if( sscanf(uri, "%s#%s", uri, fragment)==2 )    { -  +  DEBUG("Found fragment %O", fragment); +  if( !sizeof(uri) ) +  {    DEBUG("Fragment only. Using entire base URI, except fragment."); -  +  string f = fragment;    inherit_properties(this_program::base_uri); -  fragment = uri[1..]; +  fragment = f;    return;    } -  +  }    -  // Parse fragment identifier -  // fragment = *( pchar / "/" / "?" ) -  // pchar = unreserved / pct-encoded / sub-delims / ":" / "@" -  sscanf(uri, "%s#%s", uri, fragment); -  DEBUG("Found fragment %O", fragment); -  +     // Parse scheme    // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )    if(sscanf(uri, "%[A-Za-z0-9+.-]:%s", scheme, uri) < 2)    {    scheme = 0;    if(!this_program::base_uri)    error("Standards.URI: got a relative URI (no scheme) lacking a base_uri!\n");    } else {    /* RFC 3986 §3.1    *