commit 3d4781863c8caa1aea7a32ad6827556a5426b2e6 Author: Tanmai Khanna Date: Fri May 15 19:33:45 2020 +0530 works with unescaped #,$,etc. inside secondary tags diff --git a/lttoolbox/fst_processor.cc b/lttoolbox/fst_processor.cc index fe2f98e..6773dc8 100644 --- a/lttoolbox/fst_processor.cc +++ b/lttoolbox/fst_processor.cc @@ -536,8 +536,10 @@ FSTProcessor::readGeneration(FILE *input, FILE *output) if(isSecondaryTag) { - while((val = fgetwc_unlocked(input)) != L'$') + while(true) { + val = fgetwc_unlocked(input); + if(feof(input)) { streamError(); @@ -548,9 +550,28 @@ FSTProcessor::readGeneration(FILE *input, FILE *output) val = fgetwc_unlocked(input); continue; } - else if(val == L'#') + + if(isSecondaryTag) + { + if(val == L'>') + { + isSecondaryTag = false; + } + } + else { - return static_cast(L'#'); + if(val == L'<') + { + isSecondaryTag = true; + } + else if(val == L'#') + { + return static_cast(L'#'); + } + else if(val == L'$') + { + break; + } } }