Browse Source

get_full_path fix

Nicolas Cannasse 14 years ago
parent
commit
370a732106
4 changed files with 6 additions and 6 deletions
  1. 1 1
      common.ml
  2. 1 1
      genswf9.ml
  3. 2 2
      interp.ml
  4. 2 2
      main.ml

+ 1 - 1
common.ml

@@ -186,7 +186,7 @@ let find_file ctx f =
 	in
 	loop ctx.class_path
 
-let get_full_path = Extc.get_full_path
+let get_full_path f = try Extc.get_full_path f with _ -> f
 
 (* ------------------------- TIMERS ----------------------------- *)
 

+ 1 - 1
genswf9.ml

@@ -533,7 +533,7 @@ let debug_infos ?(is_min=true) ctx p =
 	if ctx.debug then begin
 		let line = Lexer.get_error_line (if is_min then p else { p with pmin = p.pmax }) in
 		if ctx.last_file <> p.pfile then begin
-			write ctx (HDebugFile (if ctx.debugger then try Common.get_full_path p.pfile with _ -> p.pfile else p.pfile));
+			write ctx (HDebugFile (if ctx.debugger then Common.get_full_path p.pfile else p.pfile));
 			ctx.last_file <- p.pfile;
 			ctx.last_line <- -1;
 		end;

+ 2 - 2
interp.ml

@@ -1388,7 +1388,7 @@ let std_lib =
 			loop VNull 0
 		);
 		"file_full_path", Fun1 (fun file ->
-			VString (Extc.get_full_path (vstring file))
+			VString (try Extc.get_full_path (vstring file) with _ -> error())
 		);
 		"sys_exe_path", Fun0 (fun() ->
 			VString (Extc.executable_path())
@@ -1806,7 +1806,7 @@ let macro_lib =
 				try
 					Hashtbl.find hfiles f
 				with Not_found ->
-					let ff = (try Common.get_full_path f with _ -> f) in
+					let ff = Common.get_full_path f in
 					let ff = String.concat "/" (ExtString.String.nsplit ff "\\") in
 					Hashtbl.add hfiles f ff;
 					ff

+ 2 - 2
main.ml

@@ -209,7 +209,7 @@ let lookup_classes com fpath =
 		| [] -> []
 		| cp :: l ->
 			let cp = (if cp = "" then "./" else cp) in
-			let c = normalize_path (try Common.get_full_path cp with _ -> cp) in
+			let c = normalize_path (Common.get_full_path cp) in
 			let clen = String.length c in
 			if clen < String.length fpath && String.sub spath 0 clen = String.lowercase c then begin
 				let path = String.sub fpath clen (String.length fpath - clen) in
@@ -474,7 +474,7 @@ try
 				Common.display_default := true;
 				Common.define com "display";
 				Parser.resume_display := {
-					Ast.pfile = (try Common.get_full_path file with _ -> file);
+					Ast.pfile = Common.get_full_path file;
 					Ast.pmin = pos;
 					Ast.pmax = pos;
 				};