소스 검색

normalize Compiler.addClassPath paths (fixed issue #1261)

Simon Krajewski 13 년 전
부모
커밋
e4684a47cd
3개의 변경된 파일9개의 추가작업 그리고 9개의 파일을 삭제
  1. 8 0
      common.ml
  2. 1 1
      interp.ml
  3. 0 8
      main.ml

+ 8 - 0
common.ml

@@ -562,6 +562,14 @@ let get_full_path f = try Extc.get_full_path f with _ -> f
 
 let unique_full_path = if Sys.os_type = "Win32" || Sys.os_type = "Cygwin" then (fun f -> String.lowercase (get_full_path f)) else get_full_path
 
+let normalize_path p =
+	let l = String.length p in
+	if l = 0 then
+		"./"
+	else match p.[l-1] with
+		| '\\' | '/' -> p
+		| _ -> p ^ "/"
+
 (* ------------------------- TIMERS ----------------------------- *)
 
 type timer_infos = {

+ 1 - 1
interp.ml

@@ -2348,7 +2348,7 @@ let macro_lib =
 			match v with
 			| VString cp ->
 				let com = ccom() in
-				com.class_path <- cp :: com.class_path;
+				com.class_path <- (Common.normalize_path cp) :: com.class_path;
 				VNull
 			| _ ->
 				error()

+ 0 - 8
main.ml

@@ -49,14 +49,6 @@ let global_cache = ref None
 let executable_path() =
 	Extc.executable_path()
 
-let normalize_path p =
-	let l = String.length p in
-	if l = 0 then
-		"./"
-	else match p.[l-1] with
-		| '\\' | '/' -> p
-		| _ -> p ^ "/"
-
 let format msg p =
 	if p = Ast.null_pos then
 		msg