Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for windows paths #2276

Merged
merged 2 commits into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/include/tangram/util/url.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class Url {
// parts describes URL components by their location within the buffer.
struct Parts {
struct Range {
uint16_t start = 0, count = 0;
size_t start = 0, count = 0;
} scheme, location, path, parameters, query, fragment, media, data;
} parts;

Expand Down
5 changes: 5 additions & 0 deletions core/src/util/url.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <cstdlib>
#include <cassert>
#include <algorithm>

namespace Tangram {

Expand Down Expand Up @@ -320,6 +321,10 @@ std::string Url::removeDotSegmentsFromString(std::string path) {
}

void Url::parse() {
#ifdef TANGRAM_WINDOWS
// Normalize Windows paths. Chromium also does this.
std::replace(buffer.begin(), buffer.end(), '\\', '/');
#endif

// The parsing process roughly follows https://tools.ietf.org/html/rfc1808#section-2.4

Expand Down