Standardized internal path handling on Posix separators.

There were several possible bugs involving paths not being
recognized as being the same on Windows. Rather than trying
to ensure all code deals with / and \ correctly, paths now
get transformed to / on input, fixing all current and
future such bugs.

Tested: on OS X.
This commit is contained in:
Wouter van Oortmerssen
2017-05-18 17:18:43 -07:00
parent 3d2cf554d7
commit aaf5598a03
4 changed files with 46 additions and 20 deletions

View File

@@ -1962,7 +1962,7 @@ CheckedError Parser::DoParse(const char *source, const char **include_paths,
Is(kTokenIdentifier))) {
NEXT();
if (opts.proto_mode && attribute_ == "public") NEXT();
auto name = attribute_;
auto name = flatbuffers::PosixPath(attribute_.c_str());
EXPECT(kTokenStringConstant);
// Look for the file in include_paths.
std::string filepath;