mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Bug Fix - #322 rc: override for shell command does not propagate
- Fixed bug #322 which failed to propagate rc overrides to shell commands. - Context now properly records overrides to file and variables. - The text.cpp:split (...) functions can now skip trivial split results.
This commit is contained in:
parent
8d784da0ae
commit
b94706c56e
6 changed files with 37 additions and 22 deletions
12
src/text.cpp
12
src/text.cpp
|
@ -57,14 +57,16 @@ void wrapText (
|
|||
void split (
|
||||
std::vector<std::string>& results,
|
||||
const std::string& input,
|
||||
const char delimiter)
|
||||
const char delimiter,
|
||||
bool nontrivial /* = true */)
|
||||
{
|
||||
results.clear ();
|
||||
std::string::size_type start = 0;
|
||||
std::string::size_type i;
|
||||
while ((i = input.find (delimiter, start)) != std::string::npos)
|
||||
{
|
||||
results.push_back (input.substr (start, i - start));
|
||||
if (!nontrivial || i != start)
|
||||
results.push_back (input.substr (start, i - start));
|
||||
start = i + 1;
|
||||
}
|
||||
|
||||
|
@ -76,7 +78,8 @@ void split (
|
|||
void split (
|
||||
std::vector<std::string>& results,
|
||||
const std::string& input,
|
||||
const std::string& delimiter)
|
||||
const std::string& delimiter,
|
||||
bool nontrivial /* = true */)
|
||||
{
|
||||
results.clear ();
|
||||
std::string::size_type length = delimiter.length ();
|
||||
|
@ -85,7 +88,8 @@ void split (
|
|||
std::string::size_type i;
|
||||
while ((i = input.find (delimiter, start)) != std::string::npos)
|
||||
{
|
||||
results.push_back (input.substr (start, i - start));
|
||||
if (!nontrivial || i != start)
|
||||
results.push_back (input.substr (start, i - start));
|
||||
start = i + length;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue