diff --git a/code/STEPFileReader.cpp b/code/STEPFileReader.cpp index 7ddfd91c3..66e08fcb5 100644 --- a/code/STEPFileReader.cpp +++ b/code/STEPFileReader.cpp @@ -318,20 +318,28 @@ boost::shared_ptr EXPRESS::DataType::Parse(const char*& else if (*cur == '\'' ) { // string literal const char* start = ++cur; - for(;*cur != '\'';++cur) { - if (*cur == '\0') { + + for(;*cur != '\'';++cur) { + if (*cur == '\0') { throw STEP::SyntaxError("string literal not closed",line); } } - if (cur[1]=='\'') { - for(cur+=2;*cur != '\'';++cur) { - if (*cur == '\0') { - throw STEP::SyntaxError("string literal not closed",line); + + if (cur[1] == '\'') { + // Vesanen: more than 2 escaped ' in one literal! + do { + for(cur += 2;*cur != '\'';++cur) { + if (*cur == '\0') { + throw STEP::SyntaxError("string literal not closed",line); + } } } + while(cur[1] == '\''); } - inout = cur+1; - return boost::make_shared(std::string(start, static_cast(cur-start) )); + + inout = cur + 1; + + return boost::make_shared(std::string(start, static_cast(cur - start))); } else if (*cur == '\"' ) { throw STEP::SyntaxError("binary data not supported yet",line); diff --git a/revision.h b/revision.h index f55c0cc89..03665b4ba 100644 --- a/revision.h +++ b/revision.h @@ -1 +1 @@ -#define SVNRevision 1154 +#define SVNRevision 1257