Explorar o código

[cs] Attempt to fix trailing slashes on mkdir paths. Relates to #2977

Cauê Waneck %!s(int64=11) %!d(string=hai) anos
pai
achega
a0fcb0de53
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      gencommon.ml

+ 4 - 2
gencommon.ml

@@ -921,8 +921,10 @@ let write_file gen w source_dir path extension =
 	let rec create acc = function
 		| [] -> ()
 		| d :: l ->
-				let dir = String.concat "/" (List.rev (d :: acc)) in
-				if dir <> "" && not (Sys.file_exists dir) then Unix.mkdir dir 0o755;
+				if d <> "" then begin
+					let dir = String.concat "/" (List.rev (d :: acc)) in
+					if not (Sys.file_exists dir) then Unix.mkdir dir 0o755
+				end;
 				create (d :: acc) l
 	in
 	let p = (String.nsplit source_dir "/") in