Skip to content

Commit

Permalink
Fix override tag argument splitting
Browse files Browse the repository at this point in the history
Correctly handle:
* empty comma-delimited arguments,
* trailing spaces in non-empty comma-delimited arguments.
  • Loading branch information
astiob authored and Cyberbeing committed Oct 1, 2014
1 parent da595cf commit 87448d2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/subtitles/RTS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2356,12 +2356,14 @@ bool CRenderedTextSubtitle::ParseSSATag( AssTagList *assTags, const CStringW& st

CStringW::PCXSTR newstart = FindChar(param_start, param_end, L',');
CStringW::PCXSTR newend = FindChar(param_start, param_end, L'\\');
if(newstart > param_start && newstart < newend)
if(newstart < newend)
{
newstart = FastSkipWhiteSpaceRight(param_start, newstart);
CStringW s(param_start, newstart - param_start);

if(!s.IsEmpty()) params.Add(s);
if(newstart > param_start)
{
newend = FastSkipWhiteSpaceRight(param_start, newstart);
CStringW s(param_start, newend - param_start);
if(!s.IsEmpty()) params.Add(s);
}
param_start = newstart + 1;
}
else if(param_start<param_end)
Expand Down

0 comments on commit 87448d2

Please sign in to comment.