Skip to content

Commit

Permalink
string: respect removeEmpty when VarList input is empty (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaideiaDilemma authored Jul 4, 2024
1 parent 1d20063 commit 259ecfa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/hyprutils/string/VarList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/string/VarList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit 259ecfa

Please sign in to comment.