-/*
- * Set the name of @branch for placing it at @target in the WIM image. This
- * assumes that @target is in "canonical form", as produced by
- * canonicalize_wim_path().
- *
- * Note: for the root target this produces the empty name.
- */
-static int
-set_branch_name(struct wim_dentry *branch, const utf16lechar *target)
-{
- const utf16lechar *p;
-
- /* Find end of string. (We can assume it contains at least one
- * character, the leading slash.) */
- wimlib_assert(target[0] == cpu_to_le16(WIM_PATH_SEPARATOR));
- p = target;
- do {
- p++;
- } while (*p);
-
- while (*(p - 1) != cpu_to_le16(WIM_PATH_SEPARATOR))
- p--;
-
-
- /* We're assuming no trailing slashes. */
- wimlib_assert(*p || p == &target[1]);
-
- return dentry_set_name_utf16le(branch, p);
-}
-