if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_RPFIX) &&
dest[0] == '/')
{
- dest = fixup_symlink(dest,
- params->capture_root_ino,
- params->capture_root_dev);
+ dest = capture_fixup_absolute_symlink(dest,
+ params->capture_root_ino,
+ params->capture_root_dev);
if (!dest) {
WARNING("Ignoring out of tree absolute symlink "
"\"%s\" -> \"%s\"\n"
}
inode->i_not_rpfixed = 0;
}
- ret = inode_set_symlink(inode, dest,
- params->lookup_table, NULL);
+ ret = wim_inode_set_symlink(inode, dest, params->lookup_table);
if (ret == 0) {
/* Unfortunately, Windows seems to have the concept of
* "file" symbolic links as being different from
ret = inode_table_new_dentry(params->inode_table,
path_basename_with_len(path, path_len),
- stbuf.st_ino,
- stbuf.st_dev,
- &root);
+ stbuf.st_ino, stbuf.st_dev, false, &root);
if (ret)
goto out;
}
-/* Strip leading and trailing forward slashes from a string. Modifies it in
- * place and returns the stripped string. */
-static const tchar *
-canonicalize_target_path(tchar *target_path)
-{
- tchar *p;
- if (target_path == NULL)
- return T("");
- for (;;) {
- if (*target_path == T('\0'))
- return target_path;
- else if (*target_path == T('/'))
- target_path++;
- else
- break;
- }
-
- p = tstrchr(target_path, T('\0')) - 1;
- while (*p == T('/'))
- *p-- = T('\0');
- return target_path;
-}
-
/* Strip leading and trailing slashes from the target paths, and translate all
* backslashes in the source and target paths into forward slashes. */
static void
/* The Windows API can handle forward slashes. Just get rid of
* backslashes to avoid confusing other parts of the library
* code. */
- zap_backslashes(sources->fs_source_path);
- if (sources->wim_target_path)
- zap_backslashes(sources->wim_target_path);
-
- sources->wim_target_path =
- (tchar*)canonicalize_target_path(sources->wim_target_path);
+ sources->fs_source_path = canonicalize_fs_path(sources->fs_source_path);
+ sources->wim_target_path = canonicalize_wim_path(sources->wim_target_path);
DEBUG("Canonical target: \"%"TS"\"", sources->wim_target_path);
sources++;
}