From c797f16b0ed322d7c483906aaf821c809bee26fb Mon Sep 17 00:00:00 2001 From: Leo Terziman Date: Wed, 18 Apr 2018 11:53:49 +0200 Subject: [PATCH] In IFC, fixed parser to avoid interpretation of '##' in string as identifiers --- code/Importer/IFC/STEPFileReader.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/code/Importer/IFC/STEPFileReader.cpp b/code/Importer/IFC/STEPFileReader.cpp index ca02f7626..ba33f3928 100644 --- a/code/Importer/IFC/STEPFileReader.cpp +++ b/code/Importer/IFC/STEPFileReader.cpp @@ -492,10 +492,17 @@ STEP::LazyObject::LazyObject(DB& db, uint64_t id,uint64_t /*line*/, const char* --skip_depth; } - if (skip_depth >= 1 && *a=='#') { - const char* tmp; - const int64_t num = static_cast( strtoul10_64(a+1,&tmp) ); - db.MarkRef(num,id); + if (skip_depth >= 1 && *a=='#') { + if (*(a + 1) != '#') + { + const char* tmp; + const int64_t num = static_cast(strtoul10_64(a + 1, &tmp)); + db.MarkRef(num, id); + } + else + { + ++a; + } } ++a; }