]> wimlib.net Git - wimlib/blobdiff - src/add_image.c
Fixes; write --{no,}rpfix docs; enable --rpfix capture by default
[wimlib] / src / add_image.c
index 8e97a8ec1e95c3b7e623dba8e5b174880fb913a9..b50b05b55400c6c01fe6d0dac616118abd73ce4a 100644 (file)
@@ -865,8 +865,13 @@ wimlib_add_image_multisource(WIMStruct *w,
 
        if ((add_image_flags & (WIMLIB_ADD_IMAGE_FLAG_RPFIX |
                                WIMLIB_ADD_IMAGE_FLAG_NORPFIX)) == 0)
-               if (w->hdr.flags & WIM_HDR_FLAG_RP_FIX)
+       {
+               /* Do reparse-point fixups by default if the header flag is set
+                * from previous images, or if this is the first image being
+                * added. */
+               if ((w->hdr.flags & WIM_HDR_FLAG_RP_FIX) || w->hdr.image_count == 0)
                        add_image_flags |= WIMLIB_ADD_IMAGE_FLAG_RPFIX;
+       }
 
        if (!name || !*name) {
                ERROR("Must specify a non-empty string for the image name");