From 50aab0f08f55e89f2c4810876976c9bd5bba9984 Mon Sep 17 00:00:00 2001 From: Dan Donovan <dansolo@none> Date: Sun, 3 Jun 2007 00:37:49 +0000 Subject: [PATCH] Don't assume override blocks always start with a backslash, since many people use them for comments Originally committed to SVN as r1202. --- aegisub/ass_override.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aegisub/ass_override.cpp b/aegisub/ass_override.cpp index ade63da6f..20a9e0240 100644 --- a/aegisub/ass_override.cpp +++ b/aegisub/ass_override.cpp @@ -112,9 +112,11 @@ void AssDialogueBlockOverride::ParseTags () { // Initialize tokenizer wxStringTokenizer tkn(text,_T("\\"),wxTOKEN_RET_EMPTY_ALL); + wxString curTag; + if (text.StartsWith(_T("\\"))) curTag = _T("\\"); while (tkn.HasMoreTokens()) { - wxString curTag = _T("\\"); + //curTag will always start with a backslash after first loop - see end of loop curTag += tkn.GetNextToken(); if (curTag == _T("\\")) continue; @@ -130,6 +132,8 @@ void AssDialogueBlockOverride::ParseTags () { AssOverrideTag *newTag = new AssOverrideTag; newTag->SetText(curTag); Tags.push_back(newTag); + + curTag = _T("\\"); } }