diff --git a/include/hyprutils/string/VarList.hpp b/include/hyprutils/string/VarList.hpp index a876111..697b51e 100644 --- a/include/hyprutils/string/VarList.hpp +++ b/include/hyprutils/string/VarList.hpp @@ -12,7 +12,7 @@ namespace Hyprutils { @param delim if delimiter is 's', use std::isspace @param removeEmpty remove empty args from argv */ - CVarList(const std::string& in, const size_t maxSize = 0, const char delim = ',', const bool removeEmpty = false); + CVarList(const std::string& in, const size_t lastArgNo = 0, const char delim = ',', const bool removeEmpty = false); ~CVarList() = default; diff --git a/src/string/VarList.cpp b/src/string/VarList.cpp index 0256087..925430c 100644 --- a/src/string/VarList.cpp +++ b/src/string/VarList.cpp @@ -6,7 +6,7 @@ using namespace Hyprutils::String; Hyprutils::String::CVarList::CVarList(const std::string& in, const size_t lastArgNo, const char delim, const bool removeEmpty) { - if (in.empty()) + if (!removeEmpty && in.empty()) m_vArgs.emplace_back(""); std::string args{in};