-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
SliceFilter::doFilter tries splits the input into parts left and right from the ":" that divides the range to output.
auto splitterIndex = argString.get().indexOf(QLatin1Char(':'));
QString inputString = getSafeString(input);
if (splitterIndex >= 0) {
auto left = argString.get().left(splitterIndex).get().toInt();
auto right = argString.get().right(splitterIndex).get().toInt();
But the right hand part is not correctly extracted, because QString::right expects the amount of characters from the right. It seems the code should be using QString::mid with the correct index adjustments instead.
Test cases:
data|slice:"0:10" returns the empty string, because it uses only "0" as right side.
data|slice:"00:-1" works because because "00" and "-1" are the same lenght.
pcolby
Metadata
Metadata
Assignees
Labels
No labels