Skip to content

Commit

Permalink
Fix is_absolute on WASI
Browse files Browse the repository at this point in the history
WASI does not match `cfg(unix)`, but its paths are Unix-like (`/some/path`) and don't have Windows-like prefixes.

Without this change, `is_absolute` for paths like `/some/path` was returning `false`on a WASI target, which is obviously not true and undesirable.
  • Loading branch information
RReverser committed Sep 30, 2020
1 parent 12f667f commit 494d6e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/path.rs
Expand Up @@ -1838,7 +1838,7 @@ impl Path {
// FIXME: Allow Redox prefixes
self.has_root() || has_redox_scheme(self.as_u8_slice())
} else {
self.has_root() && (cfg!(unix) || self.prefix().is_some())
self.has_root() && (cfg!(any(unix, target_os = "wasi")) || self.prefix().is_some())
}
}

Expand Down

0 comments on commit 494d6e5

Please sign in to comment.