Fix buggy error message problem
authorChris Lattner <sabre@nondot.org>
Fri, 13 Feb 2004 16:33:56 +0000 (16:33 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 13 Feb 2004 16:33:56 +0000 (16:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11379 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/FileLexer.l

index a941c9fb069192d705260f6a14da9e0c16c1be08..ec22afdb1fc450d8f6084e74676914645055016b 100644 (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...