mirror of
https://github.com/hyprwm/hyprutils.git
synced 2024-11-17 00:15:58 +01:00
string: respect removeEmpty when VarList input is empty (#7)
This commit is contained in:
parent
1d20063da2
commit
259ecfa098
2 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ namespace Hyprutils {
|
||||||
@param delim if delimiter is 's', use std::isspace
|
@param delim if delimiter is 's', use std::isspace
|
||||||
@param removeEmpty remove empty args from argv
|
@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;
|
~CVarList() = default;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
using namespace Hyprutils::String;
|
using namespace Hyprutils::String;
|
||||||
|
|
||||||
Hyprutils::String::CVarList::CVarList(const std::string& in, const size_t lastArgNo, const char delim, const bool removeEmpty) {
|
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("");
|
m_vArgs.emplace_back("");
|
||||||
|
|
||||||
std::string args{in};
|
std::string args{in};
|
||||||
|
|
Loading…
Reference in a new issue