1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-12 19:22:37 +00:00

fix include paths parsing under Windows (#541)

This commit is contained in:
elderorb 2022-12-15 15:55:11 +04:00 committed by GitHub
parent b4c55742a6
commit 4d09d04a42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 4 deletions

View file

@ -810,14 +810,22 @@ void usage(const char* progname) {
std::exit(2);
}
constexpr char include_path_separator =
#if _WIN32
';'
#else
':'
#endif //
;
void parse_include_path_set(std::string include_path_set, std::vector<std::string>& res) {
td::Parser parser(include_path_set);
while (!parser.empty()) {
auto path = parser.read_till_nofail(':');
auto path = parser.read_till_nofail(include_path_separator);
if (!path.empty()) {
res.push_back(path.str());
}
parser.skip_nofail(':');
parser.skip_nofail(include_path_separator);
}
}

View file

@ -72,14 +72,22 @@ void usage(const char* progname) {
std::exit(2);
}
constexpr char include_path_separator =
#if _WIN32
';'
#else
':'
#endif //
;
void parse_include_path_set(std::string include_path_set, std::vector<std::string>& res) {
td::Parser parser(include_path_set);
while (!parser.empty()) {
auto path = parser.read_till_nofail(':');
auto path = parser.read_till_nofail(include_path_separator);
if (!path.empty()) {
res.push_back(path.str());
}
parser.skip_nofail(':');
parser.skip_nofail(include_path_separator);
}
}