diff options
Diffstat (limited to 'externals')
-rw-r--r-- | externals/grill/pool/pool.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/externals/grill/pool/pool.cpp b/externals/grill/pool/pool.cpp index 76a61cc0..4d6d100e 100644 --- a/externals/grill/pool/pool.cpp +++ b/externals/grill/pool/pool.cpp @@ -616,12 +616,15 @@ static bool gettag(istream &is,xmltag &tag) } if(!*c) { // is comment - char cmp[2] = {0,0}; + char cmp[2] = {0,0}; // set to some unusual initial value + for(int ic = 0; ; ic = (++ic)%2) { char c = is.get(); if(c == '>') { - for(int i = 0; i < 2 && cmp[(ic+i)%2] == commend[i]; ++i); - if(i == 2) break; // comment end! + // if third character is > then check also the former two + int i; + for(i = 0; i < 2 && cmp[(ic+i)%2] == commend[i]; ++i); + if(i == 2) break; // match: comment end found! } else cmp[ic] = c; |