Fix buggy error message problem

llvm-svn: 11379
This commit is contained in:
Chris Lattner 2004-02-13 16:33:56 +00:00
parent 29cb68f761
commit a80e9f0a19
1 changed files with 3 additions and 2 deletions

View File

@ -126,12 +126,13 @@ static void HandleInclude(const char *Buffer) {
//
// NOTE: Right now, there is only one directory. We need to eventually add
// support for more.
Filename = IncludeDirectory + "/" + Filename;
yyin = fopen(Filename.c_str(), "r");
std::string NextFilename = IncludeDirectory + "/" + Filename;
yyin = fopen(NextFilename.c_str(), "r");
if (yyin == 0) {
err() << "Could not find include file '" << Filename << "'!\n";
abort();
}
Filename = NextFilename;
}
// Add the file to our include stack...