Commit 2726d45a authored by Andrei Paskevich's avatar Andrei Paskevich

fix driver import with relative paths

parent 9e5aab7b
......@@ -56,14 +56,12 @@ let load_plugin dir (byte,nat) =
Dynlink.loadfile_private file
let load_file file =
let basename = Filename.dirname file in
let c = open_in file in
let lb = Lexing.from_channel c in
Loc.set_file file lb;
let to_close = Stack.create () in
Stack.push c to_close;
let input_lexer s =
let filename = Sysutil.absolutize_filename basename s in
let input_lexer filename =
let c = open_in filename in
Stack.push c to_close;
let lb = Lexing.from_channel c in
......
......@@ -122,6 +122,8 @@ rule token = parse
Loc.transfer_loc lexbuf lex_dumb;
match tok with
| INPUT filename ->
let dirname = Filename.dirname lexbuf.lex_curr_p.pos_fname in
let filename = Sysutil.absolutize_filename dirname filename in
Stack.push (input_lexbuf filename) s;
multifile lex_dumb
| EOF -> ignore (Stack.pop s);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment