Nicolas Cannasse 18 år sedan
förälder
incheckning
73326670d7
2 ändrade filer med 2 tillägg och 1 borttagningar
  1. 1 0
      doc/CHANGES.txt
  2. 1 1
      main.ml

+ 1 - 0
doc/CHANGES.txt

@@ -21,6 +21,7 @@
 	fixed very tricky typing bug with constructors inheritance
 	fixed very tricky typing bug with constructors inheritance
 	fixed some documentation related parser bug
 	fixed some documentation related parser bug
 	fixed stack overflow with static setter
 	fixed stack overflow with static setter
+	fixed package completion bug when -cp points to an not existing dir
 
 
 2007-07-25: 1.14
 2007-07-25: 1.14
 	fixed no error when invalid "catch" expression
 	fixed no error when invalid "catch" expression

+ 1 - 1
main.ml

@@ -129,7 +129,7 @@ let read_type_path p cp =
 	let p = (match p with "flash" :: l when Plugin.defined "flash9" -> "flash9" :: l | _ -> p) in
 	let p = (match p with "flash" :: l when Plugin.defined "flash9" -> "flash9" :: l | _ -> p) in
 	List.iter (fun path ->
 	List.iter (fun path ->
 		let dir = path ^ String.concat "/" p in
 		let dir = path ^ String.concat "/" p in
-		let r = Sys.readdir dir in
+		let r = (try Sys.readdir dir with _ -> [||]) in
 		Array.iter (fun f ->
 		Array.iter (fun f ->
 			if (Unix.stat (dir ^ "/" ^ f)).Unix.st_kind = Unix.S_DIR then begin
 			if (Unix.stat (dir ^ "/" ^ f)).Unix.st_kind = Unix.S_DIR then begin
 				if f.[0] > 'a' && f.[0] < 'z' then packages := f :: !packages
 				if f.[0] > 'a' && f.[0] < 'z' then packages := f :: !packages