mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
UTF8 Line Extraction
- Minor efficiency modification, made while fixing a bug.
This commit is contained in:
parent
b230da75e6
commit
e6804a1679
1 changed files with 6 additions and 4 deletions
10
src/text.cpp
10
src/text.cpp
|
@ -326,19 +326,21 @@ void extractLine (
|
||||||
last_space = previous;
|
last_space = previous;
|
||||||
|
|
||||||
// Record last seen comma.
|
// Record last seen comma.
|
||||||
if (character == ',')
|
else if (character == ',' ||
|
||||||
|
character == ';' ||
|
||||||
|
character == '.')
|
||||||
last_comma = previous;
|
last_comma = previous;
|
||||||
|
|
||||||
// Newline is an early break point.
|
// Newline is an early break point.
|
||||||
if (character == '\n')
|
else if (character == '\n')
|
||||||
{
|
{
|
||||||
line = text.substr (0, bytes - 1);
|
line = text.substr (0, previous);
|
||||||
text = text.substr (bytes);
|
text = text.substr (bytes);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// EOS is an early break point.
|
// EOS is an early break point.
|
||||||
if (character == 0)
|
else if (character == 0)
|
||||||
{
|
{
|
||||||
line = text;
|
line = text;
|
||||||
text = "";
|
text = "";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue