goto out_destroy_stream_list;
}
ctx.realtarget_nchars = tstrlen(ctx.realtarget);
+ #ifdef __WIN32__
+ /* Strip trailing slashes. If we don't do this, we may create a
+ * path with multiple consecutive backslashes, which for some
+ * reason causes Windows to report that the file cannot be found.
+ */
+ while (ctx.realtarget_nchars >= 2
+ && ctx.realtarget[ctx.realtarget_nchars - 1] == L'\\'
+ && ctx.realtarget[ctx.realtarget_nchars - 2] != L':')
+ {
+ ctx.realtarget[--ctx.realtarget_nchars] = L'\0';
+ }
+ #endif
}
if (progress_func) {
wmemcpy(path, root_disk_path, path_nchars + 1);
}
+ /* Strip trailing slashes. If we don't do this, we may create a path
+ * with multiple consecutive backslashes, which for some reason causes
+ * Windows to report that the file cannot be found. */
+ while (path_nchars >= 2 &&
+ path[path_nchars - 1] == L'\\' &&
+ path[path_nchars - 2] != L':')
+ {
+ path[--path_nchars] = L'\0';
+ }
+
params->capture_root_nchars = path_nchars;
memset(&state, 0, sizeof(state));