Skip to content

Commit 09013e4

Browse files
Eduard Millerkinnison
authored andcommitted
Allow current dir for component unpack
1 parent b7e79de commit 09013e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/dist/component/package.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,12 @@ fn unpack_without_first_dir<'a, R: Read>(
332332
let path = path.chain_err(|| ErrorKind::ExtractingPackage)?;
333333
path.into_owned()
334334
};
335-
// Reject path components that are not normal (.|..|/| etc)
335+
// Reject path components that are not normal (..|/| etc)
336336
for part in relpath.components() {
337337
match part {
338-
std::path::Component::Normal(_) => {}
338+
// Some very early rust tarballs include a "." segment which we have to
339+
// support, despite not liking it.
340+
std::path::Component::Normal(_) | std::path::Component::CurDir => {}
339341
_ => return Err(ErrorKind::BadPath(relpath).into()),
340342
}
341343
}

0 commit comments

Comments
 (0)