summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-29 10:10:41 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-29 10:28:20 -0700
commit861db9adace20a187fc1cabc953bd3c0dfffd16e (patch)
treeeadd130a32b1dbdde189cac6b715d472fc9bd634
parent40ca99b2d6bc6d4046d2b74438dc9ea769d28c5b (diff)
downloadssh2-rs-861db9adace20a187fc1cabc953bd3c0dfffd16e.zip
Fix build on windows
-rw-r--r--src/util.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.rs b/src/util.rs
index c2936b6..1955431 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -37,9 +37,9 @@ pub fn path2bytes(p: &Path) -> Result<&[u8], Error> {
#[cfg(windows)]
pub fn path2bytes(p: &Path) -> Result<&[u8], Error> {
match p.to_str() {
- Some(s) => check(s),
- None => Error::new(raw::LIBSSH2_ERROR_INVAL,
- "only unicode paths on windows may be used"),
+ Some(s) => check(s.as_bytes()),
+ None => Err(Error::new(raw::LIBSSH2_ERROR_INVAL,
+ "only unicode paths on windows may be used")),
}
}