From 090c0d4014485fea7507b47231d68c6d56b82dd8 Mon Sep 17 00:00:00 2001 From: haxala1r Date: Thu, 27 Nov 2025 19:59:53 +0300 Subject: [PATCH] Small fix --- bin/tar.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/tar.ml b/bin/tar.ml index 91331aa..5b15162 100644 --- a/bin/tar.ml +++ b/bin/tar.ml @@ -93,10 +93,13 @@ let rec add_deep node = function add_direct one (add_deep node (rest, (find_or_infer_dir one dir))) dir | (_, dir) -> dir -let inc_nlink path tree = +let rec inc_nlink path tree = add_deep (match find path tree with | Some (File (o, md)) -> File (o, {md with st_nlink = md.st_nlink + 1}) + | Some (InferredDirectory (o, md)) -> InferredDirectory (o, {md with st_nlink = md.st_nlink + 1}) + | Some (Symlink (o, md)) -> Symlink (o, {md with st_nlink = md.st_nlink + 1}) + | Some (Hardlink p) -> inc_nlink p tree | Some (Directory (o, md)) -> Directory (o, {md with st_nlink = md.st_nlink + 1}) | _ -> failwith "can't increase hardlink count...") (clean_path path, tree)