about summary refs log tree commit diff
path: root/src/libstd/old_io/process.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-02-18 18:02:58 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-02-19 07:03:18 -0800
commit0cd54b85ef1fdad3bc4c1c4e1a989b9f6540a0fa (patch)
treeb2973ab6fdb99ec1d3ff8fd930f29cf78da183f4 /src/libstd/old_io/process.rs
parentcb29c468f38ba93f624277c2c3a8e46a4d85e619 (diff)
downloadrust-0cd54b85ef1fdad3bc4c1c4e1a989b9f6540a0fa.tar.gz
rust-0cd54b85ef1fdad3bc4c1c4e1a989b9f6540a0fa.zip
Round 5 test fixes and rebase conflicts
Diffstat (limited to 'src/libstd/old_io/process.rs')
-rw-r--r--src/libstd/old_io/process.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libstd/old_io/process.rs b/src/libstd/old_io/process.rs
index c761bf705a8..c803cfbcb7d 100644
--- a/src/libstd/old_io/process.rs
+++ b/src/libstd/old_io/process.rs
@@ -104,7 +104,7 @@ struct EnvKey(CString);
 #[derive(Eq, Clone, Debug)]
 struct EnvKey(CString);
 
-#[cfg(windows)]
+#[cfg(all(windows, stage0))]
 impl<H: hash::Writer + hash::Hasher> hash::Hash<H> for EnvKey {
     fn hash(&self, state: &mut H) {
         let &EnvKey(ref x) = self;
@@ -116,6 +116,18 @@ impl<H: hash::Writer + hash::Hasher> hash::Hash<H> for EnvKey {
         }
     }
 }
+#[cfg(all(windows, not(stage0)))]
+impl hash::Hash for EnvKey {
+    fn hash<H: hash::Hasher>(&self, state: &mut H) {
+        let &EnvKey(ref x) = self;
+        match str::from_utf8(x.as_bytes()) {
+            Ok(s) => for ch in s.chars() {
+                (ch as u8 as char).to_lowercase().hash(state);
+            },
+            Err(..) => x.hash(state)
+        }
+    }
+}
 
 #[cfg(windows)]
 impl PartialEq for EnvKey {