summaryrefslogtreecommitdiffstats
path: root/Source/cmUseMangledMesaCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-03-27 17:24:30 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-03-27 17:24:30 (GMT)
commita9875aa62f41ed13b54ea9f92c65ade9f0df6845 (patch)
treeeac19ea62e63cd53b73a29144ed997e6e683ee63 /Source/cmUseMangledMesaCommand.cxx
parentb133b832fdcb50bc7bb9dc4bfb0631bb9aa6989e (diff)
downloadCMake-a9875aa62f41ed13b54ea9f92c65ade9f0df6845.zip
CMake-a9875aa62f41ed13b54ea9f92c65ade9f0df6845.tar.gz
CMake-a9875aa62f41ed13b54ea9f92c65ade9f0df6845.tar.bz2
Implement GetLineFromStream that actually works and use it instead of getline
Diffstat (limited to 'Source/cmUseMangledMesaCommand.cxx')
-rw-r--r--Source/cmUseMangledMesaCommand.cxx33
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();