Skip to content

Commit abece51

Browse files
committed
fix bug in bufferedGetStepLine
1 parent d46787f commit abece51

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

IfcPlusPlus/src/ifcpp/geometry/CSG_Adapter.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,12 @@ namespace CSG_Adapter
191191
}
192192

193193
bool dump_result_mesh = false;
194-
//if (csg_compute_count == 24 || tag == 1311603)
194+
if ( tag == 1311603)
195+
{
196+
dump_result_mesh = true;
197+
}
198+
if (csg_compute_count == 24 )
195199
{
196-
//GeomDebugDump::dumpOperands(op1, op2, result, tag, op1_dumped, op2_dumped, dumpColorSettings, paramsScaled);
197200
dump_result_mesh = true;
198201
}
199202

IfcPlusPlus/src/ifcpp/reader/ReaderUtil.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,19 @@ std::istream& bufferedGetStepLine(std::istream& inputStream, std::string& lineOu
174174
std::streambuf* sb = inputStream.rdbuf();
175175
bool inString = false;
176176

177+
#ifdef _DEBUG
178+
std::string string40;
179+
#endif
180+
177181
// std::getline does not work with all line endings, reads complete file instead.
178182
// Handle \n (unix), \r\n (windows), \r (mac) line endings here
179183
while(true)
180184
{
181-
int c = sb->sbumpc();
185+
int c = sb->sbumpc(); // sbumpc: character at the current position and advances the current position to the next character
182186
#ifdef _DEBUG
183187
std::string charAsString;
184188
charAsString += ((char)c);
189+
string40 += charAsString;
185190
#endif
186191
switch (c)
187192
{
@@ -200,12 +205,11 @@ std::istream& bufferedGetStepLine(std::istream& inputStream, std::string& lineOu
200205
continue;
201206
}
202207
case '\'':
203-
if( sb->sgetc() != '/' ) // sgetc: character at the current position
204-
{
205-
inString = !inString;
206-
}
208+
{
209+
inString = !inString;
207210
lineOut += (char)c;
208211
continue;
212+
}
209213
case '/':
210214
if( !inString )
211215
{

0 commit comments

Comments
 (0)