about summary refs log tree commit diff
path: root/src/lib/io.rs
diff options
context:
space:
mode:
authorLindsey Kuper <lkuper@mozilla.com>2011-03-18 12:32:54 -0700
committerLindsey Kuper <lkuper@mozilla.com>2011-03-18 12:32:54 -0700
commit6dee1ac161a22a4bc1e49c5dac3c7bbba1ff97f0 (patch)
treef423d576e977e7a258f09e50e5a51702525782e2 /src/lib/io.rs
parent830f2d02f19b45ff4b4a4d7946b69f206b5dcdff (diff)
parent6f65ce5255ac16204490bdd7dcf99acd24876bc6 (diff)
Merge branch 'master' of git://github.com/graydon/rust
Diffstat (limited to 'src/lib/io.rs')
-rw-r--r--src/lib/io.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/io.rs b/src/lib/io.rs
index 7135c2bc857..a84fbbe995e 100644
--- a/src/lib/io.rs
+++ b/src/lib/io.rs
@@ -52,7 +52,8 @@ state obj FILE_reader(os.libc.FILE f, bool must_close) {
       auto buf = "";
       while (true) {
         auto ch = os.libc.fgetc(f);
-        if (ch == -1) {break;} if (ch == 10) {break;}
+        if (ch == -1) { ret buf; }
+        if (ch == 10) { ret buf; }
         buf += _str.unsafe_from_bytes(vec(ch as u8));
       }
       ret buf;
@@ -61,7 +62,7 @@ state obj FILE_reader(os.libc.FILE f, bool must_close) {
         auto buf = "";
         while (true) {
             auto ch = os.libc.fgetc(f);
-            if (ch < 1) {break;}
+            if (ch < 1) { ret buf; }
             buf += _str.unsafe_from_bytes(vec(ch as u8));
         }
         ret buf;