journaled_link() needs to be last because it commits the branch.
Also, it's supposed to check WIMLIB_ADD_FLAG_VERBOSE.
/* Replace nondirectory file */
struct wim_dentry *parent;
int ret;
/* Replace nondirectory file */
struct wim_dentry *parent;
int ret;
- union wimlib_progress_info info;
parent = existing->parent;
parent = existing->parent;
- ret = journaled_unlink(j, existing);
- if (ret)
- return ret;
+ if (add_flags & WIMLIB_ADD_FLAG_VERBOSE) {
+ union wimlib_progress_info info;
+
+ info.replace.path_in_wim = existing->_full_path;
+ ret = call_progress(progfunc,
+ WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM,
+ &info, progctx);
+ if (ret)
+ return ret;
+ }
- ret = journaled_link(j, branch, parent);
+ ret = journaled_unlink(j, existing);
-
- info.replace.path_in_wim = existing->_full_path;
- return call_progress(progfunc,
- WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM,
- &info, progctx);
+ return journaled_link(j, branch, parent);