If we follow an absolute symlink there's no need to prefix the path with
a "/", since by definition it already has one.
This helps suppressing double "/" in resolved paths containing absolute
symlinks.
return -ENOMEM;
}
- }
-
- /* Prefix what's left to do with what we just read, and start the loop again,
- * but remain in the current directory. */
-
- joined = strjoin("/", destination, todo);
+ /* Prefix what's left to do with what we just read, and start the loop again, but
+ * remain in the current directory. */
+ joined = strjoin(destination, todo);
+ } else
+ joined = strjoin("/", destination, todo);
if (!joined)
return -ENOMEM;