Skip to content

Commit edf7206

Browse files
authored
Merge pull request #1521 from reitermarkus/fix-symlink
Fix `utils::copy_file` for symlink.
2 parents 416f4e9 + ebbfced commit edf7206

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/rustup-utils/src/utils.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,7 @@ pub fn copy_file(src: &Path, dest: &Path) -> Result<()> {
311311
path: PathBuf::from(src),
312312
})?;
313313
if metadata.file_type().is_symlink() {
314-
let link = fs::read_link(src).chain_err(|| ErrorKind::ReadingFile {
315-
name: "link contents for",
316-
path: PathBuf::from(src),
317-
})?;
318-
symlink_file(&link, dest).map(|_| ())
314+
symlink_file(&src, dest).map(|_| ())
319315
} else {
320316
fs::copy(src, dest)
321317
.chain_err(|| ErrorKind::CopyingFile {

0 commit comments

Comments
 (0)