about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorJeremy Soller <jackpot51@gmail.com>2017-10-24 19:34:56 -0600
committerJeremy Soller <jackpot51@gmail.com>2017-11-04 19:58:09 -0600
commitef76ebf28c70d7c68b482295b65be56aaf10588a (patch)
tree948fc68b2aa06cc2db67ac7dd08c521c53c7e6de /src/libstd
parent12e6b53744a0101f28855f25e6e4551e2d664857 (diff)
downloadrust-ef76ebf28c70d7c68b482295b65be56aaf10588a.tar.gz
rust-ef76ebf28c70d7c68b482295b65be56aaf10588a.zip
Allow absolute if either contains root or a scheme
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/path.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 294743ed2cc..c0be5e855a0 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -1691,11 +1691,11 @@ impl Path {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[allow(deprecated)]
     pub fn is_absolute(&self) -> bool {
-        if !cfg!(target_os = "redox") {
-            self.has_root() && (cfg!(unix) || self.prefix().is_some())
-        } else {
+        if cfg!(target_os = "redox") {
             // FIXME: Allow Redox prefixes
-            has_redox_scheme(self.as_u8_slice())
+            self.has_root() || has_redox_scheme(self.as_u8_slice())
+        } else {
+            self.has_root() && (cfg!(unix) || self.prefix().is_some())
         }
     }