]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.23
authorfred <fred>
Wed, 15 Jan 1997 20:33:54 +0000 (20:33 +0000)
committerfred <fred>
Wed, 15 Jan 1997 20:33:54 +0000 (20:33 +0000)
src/lexerinit.cc

index b401071f3a5c967a927de5db630fb12467724cb3..cd2dc79719a50d36e138947933fde267b83538a9 100644 (file)
@@ -1,6 +1,7 @@
 #include <fstream.h>
 #include "lexer.hh"
 #include "debug.hh"
+#include "main.hh"
 
 My_flex_lexer *lexer=0;
 
@@ -41,16 +42,18 @@ Input_file::Input_file(String s)
 {
     name = s;
     line = 1;
-    if (s=="")
+    String pf(s);
+    if (pf=="")
        is = &cin;
-    else
-       is = new ifstream( s );
-    
-   if ( ! *is) {
-       String e("can\'t open `"  + s+"\'");
-      error(e);
-   }
-   cout << "["<<s<<flush;
+    else {
+       pf =find_file(pf);
+       if (pf=="") {
+           String e("can\'t open `"  + s+"\'");
+           error(e);
+       }
+       is = new ifstream(  pf);
+    }
+    cout << "["<<pf<<flush;
 }
 
 Input_file::~Input_file()