瀏覽代碼

Full path on windows too

Hugh Sanderson 14 年之前
父節點
當前提交
26e561064d
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      gencpp.ml

+ 5 - 5
gencpp.ml

@@ -109,10 +109,10 @@ let rec make_class_directories base dir_list =
                    | "" ->  dir
                    | "/" -> "/" ^ dir
                    | _ -> base ^ "/" ^ dir  in
-                if ( not ( (path="") ||
-                     ( ((String.length path)=3) && ((String.sub path 1 1)=":") ) ) ) then
-		   if not (Sys.file_exists path) then
-			Unix.mkdir path 0o755;
+         if ( not ( (path="") ||
+           ( ((String.length path)=2) && ((String.sub path 1 1)=":") ) ) ) then
+		         if not (Sys.file_exists path) then
+			          Unix.mkdir path 0o755;
 		make_class_directories (if (path="") then "/" else path) remaining 
 	);;
 
@@ -129,7 +129,7 @@ let new_cpp_file base_dir = new_source_file base_dir "src" ".cpp";;
 let new_header_file base_dir = new_source_file base_dir "include" ".h";;
 
 let make_base_directory file =
-	make_class_directories "" ( ( Str.split_delim (Str.regexp_string "/") file ) );
+	make_class_directories "" ( ( Str.split_delim (Str.regexp "[\\/]+") file ) );
 
 
 (* CPP code generation context *)