diff --git a/main.cpp b/main.cpp index 3e6959f..3267668 100644 --- a/main.cpp +++ b/main.cpp @@ -66,25 +66,14 @@ int add_cpp(const std::string& name) { bool contains(const std::vector& v, const std::string& s) { return std::find(v.begin(), v.end(), s) != v.end(); } -std::vector split(std::string str) +std::vector split(const std::string& str) { std::vector strings; - char tmp[100]; - int tmp_p = 0, str_p = 0; - while (str[str_p]!=0) - { - if (str[str_p]!=32) - tmp[tmp_p++] = str[str_p++]; - else - { - tmp[tmp_p]=0; - strings.push_back(tmp); - tmp_p=0; while (str[str_p]==32) str_p++; - } + std::stringstream ss(str); + std::string token; + while (ss >> token) { + strings.push_back(token); } - tmp[tmp_p]=0; - strings.push_back(tmp); - return strings; } @@ -473,7 +462,8 @@ std::cout << " |___/ v" << LAGUEIRTO_VERSION << std::endl; exit(1); } } else { - std::string path = "." + folder_char + src_path; + std::filesystem::path path = src_path; + //std::string path = "." + folder_char + src_path; if (recursive) { for (const auto &entry : std::filesystem::recursive_directory_iterator(path)) { diff --git a/version.h b/version.h index 5319073..f574640 100644 --- a/version.h +++ b/version.h @@ -1,3 +1,3 @@ #pragma once -#define LAGUEIRTO_VERSION "2.2.0" +#define LAGUEIRTO_VERSION "2.2.1"