Skip to content

Commit ef76ebf

Browse files
committed
Allow absolute if either contains root or a scheme
1 parent 12e6b53 commit ef76ebf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libstd/path.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1691,11 +1691,11 @@ impl Path {
16911691
#[stable(feature = "rust1", since = "1.0.0")]
16921692
#[allow(deprecated)]
16931693
pub fn is_absolute(&self) -> bool {
1694-
if !cfg!(target_os = "redox") {
1695-
self.has_root() && (cfg!(unix) || self.prefix().is_some())
1696-
} else {
1694+
if cfg!(target_os = "redox") {
16971695
// FIXME: Allow Redox prefixes
1698-
has_redox_scheme(self.as_u8_slice())
1696+
self.has_root() || has_redox_scheme(self.as_u8_slice())
1697+
} else {
1698+
self.has_root() && (cfg!(unix) || self.prefix().is_some())
16991699
}
17001700
}
17011701

0 commit comments

Comments
 (0)