Skip to content

Commit

Permalink
fix bug in bufferedGetStepLine
Browse files Browse the repository at this point in the history
  • Loading branch information
ifcquery committed Jul 16, 2023
1 parent d46787f commit abece51
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
7 changes: 5 additions & 2 deletions IfcPlusPlus/src/ifcpp/geometry/CSG_Adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,12 @@ namespace CSG_Adapter
}

bool dump_result_mesh = false;
//if (csg_compute_count == 24 || tag == 1311603)
if ( tag == 1311603)
{
dump_result_mesh = true;
}
if (csg_compute_count == 24 )
{
//GeomDebugDump::dumpOperands(op1, op2, result, tag, op1_dumped, op2_dumped, dumpColorSettings, paramsScaled);
dump_result_mesh = true;
}

Expand Down
14 changes: 9 additions & 5 deletions IfcPlusPlus/src/ifcpp/reader/ReaderUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,19 @@ std::istream& bufferedGetStepLine(std::istream& inputStream, std::string& lineOu
std::streambuf* sb = inputStream.rdbuf();
bool inString = false;

#ifdef _DEBUG
std::string string40;
#endif

// std::getline does not work with all line endings, reads complete file instead.
// Handle \n (unix), \r\n (windows), \r (mac) line endings here
while(true)
{
int c = sb->sbumpc();
int c = sb->sbumpc(); // sbumpc: character at the current position and advances the current position to the next character
#ifdef _DEBUG
std::string charAsString;
charAsString += ((char)c);
string40 += charAsString;
#endif
switch (c)
{
Expand All @@ -200,12 +205,11 @@ std::istream& bufferedGetStepLine(std::istream& inputStream, std::string& lineOu
continue;
}
case '\'':
if( sb->sgetc() != '/' ) // sgetc: character at the current position
{
inString = !inString;
}
{
inString = !inString;
lineOut += (char)c;
continue;
}
case '/':
if( !inString )
{
Expand Down

0 comments on commit abece51

Please sign in to comment.