diff options
Diffstat (limited to 'Source/cmUseMangledMesaCommand.cxx')
-rw-r--r-- | Source/cmUseMangledMesaCommand.cxx | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx index 734865e..57f7fb0 100644 --- a/Source/cmUseMangledMesaCommand.cxx +++ b/Source/cmUseMangledMesaCommand.cxx @@ -98,34 +98,29 @@ CopyAndFullPathMesaHeader(const char* source, cmRegularExpression glDirLine("(gl|GL)(/|\\\\)([^<\"]+)"); // regular expression for gl GL or xmesa in a file (match(1) of above) cmRegularExpression glLine("(gl|GL|xmesa)"); - while(fin) + while(cmSystemTools::GetLineFromStream(fin,inLine)) { - fin.getline(buffer, bufSize); - if(fin) + if(includeLine.find(inLine.c_str())) { - inLine = buffer; - if(includeLine.find(inLine.c_str())) + std::string includeFile = includeLine.match(1); + if(glDirLine.find(includeFile.c_str())) { - std::string includeFile = includeLine.match(1); - if(glDirLine.find(includeFile.c_str())) - { - std::string gfile = glDirLine.match(3); - fout << "#include \"" << outdir << "/" << gfile.c_str() << "\"\n"; - } - else if(glLine.find(includeFile.c_str())) - { - fout << "#include \"" << outdir << "/" << includeLine.match(1).c_str() << "\"\n"; - } - else - { - fout << inLine << "\n"; - } + std::string gfile = glDirLine.match(3); + fout << "#include \"" << outdir << "/" << gfile.c_str() << "\"\n"; + } + else if(glLine.find(includeFile.c_str())) + { + fout << "#include \"" << outdir << "/" << includeLine.match(1).c_str() << "\"\n"; } else { fout << inLine << "\n"; } } + else + { + fout << inLine << "\n"; + } } // close the files before attempting to copy fin.close(); |