]> wimlib.net Git - wimlib/blobdiff - src/extract.c
pipable WIM extraction: Take into account HARDLINKBYTES
[wimlib] / src / extract.c
index 446b55551b29337b6e2d5fdd08e027b58fa2162b..a8864af0cdccf97f7e355175f252311db7a1c49d 100644 (file)
@@ -2056,10 +2056,17 @@ extract_tree(WIMStruct *wim, const tchar *wim_source_path, const tchar *target,
                 * However, we can get a reasonably accurate estimate by taking
                 * <TOTALBYTES> from the corresponding <IMAGE> in the WIM XML
                 * data.  This does assume that a full image is being extracted,
-                * but currently there is no API for doing otherwise.  */
+                * but currently there is no API for doing otherwise.  (Also,
+                * subtract <HARDLINKBYTES> from this if hard links are
+                * supported by the extraction mode.)  */
                ctx.progress.extract.total_bytes =
                        wim_info_get_image_total_bytes(wim->wim_info,
                                                       wim->current_image);
+               if (ctx.supported_features.hard_links) {
+                       ctx.progress.extract.total_bytes -=
+                               wim_info_get_image_hard_link_bytes(wim->wim_info,
+                                                                  wim->current_image);
+               }
        }
 
        /* Handle the special case of extracting a file to standard