Skip to content

Commit

Permalink
Effective URL search for parameters (?)
Browse files Browse the repository at this point in the history
  • Loading branch information
peak3d committed Apr 10, 2018
1 parent a7eca16 commit a7a59e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.cpp
Expand Up @@ -277,7 +277,11 @@ bool adaptive::AdaptiveTree::download(const char* url, const std::map<std::strin
effective_url_ = file.GetPropertyValue(ADDON_FILE_PROPERTY_EFFECTIVE_URL, "");
kodi::Log(ADDON_LOG_DEBUG, "Effective URL %s", effective_url_.c_str());

std::string::size_type paramPos = effective_url_.find_last_of('/', effective_url_.length());
std::string::size_type paramPos = effective_url_.find_first_of('?', effective_url_.length());
if (paramPos != std::string::npos)
effective_url_.resize(paramPos);

paramPos = effective_url_.find_last_of('/', effective_url_.length());
if (paramPos != std::string::npos)
effective_url_.resize(paramPos + 1);
else
Expand Down

0 comments on commit a7a59e4

Please sign in to comment.