File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
branches/auto/src/libcore Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
14
14
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
15
15
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
16
16
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17
- refs/heads/auto: 45ae3402e034e83d254d1bc36914f8433202bad9
17
+ refs/heads/auto: db1a274bf54343605c8ac3a38a6c69f7d930192b
18
18
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
19
19
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
Original file line number Diff line number Diff line change @@ -868,9 +868,19 @@ impl Reader for *libc::FILE {
868
868
assert ! ( buf_len >= len) ;
869
869
870
870
let count = libc:: fread ( buf_p as * mut c_void , 1 u as size_t ,
871
- len as size_t , * self ) ;
871
+ len as size_t , * self ) as uint ;
872
+ if count < len {
873
+ match libc:: ferror ( * self ) {
874
+ 0 => ( ) ,
875
+ _ => {
876
+ error ! ( "error reading buffer" ) ;
877
+ error ! ( "%s" , os:: last_os_error( ) ) ;
878
+ fail ! ( ) ;
879
+ }
880
+ }
881
+ }
872
882
873
- count as uint
883
+ count
874
884
}
875
885
}
876
886
}
Original file line number Diff line number Diff line change @@ -3305,7 +3305,7 @@ mod tests {
3305
3305
}
3306
3306
3307
3307
#[ test]
3308
- fn test_each_nonempty ( ) {
3308
+ fn test_iter_nonempty ( ) {
3309
3309
let mut i = 0 ;
3310
3310
for each( ~[ 1 , 2 , 3 ] ) |v| {
3311
3311
i += * v;
@@ -3314,7 +3314,7 @@ mod tests {
3314
3314
}
3315
3315
3316
3316
#[ test]
3317
- fn test_eachi ( ) {
3317
+ fn test_iteri ( ) {
3318
3318
let mut i = 0 ;
3319
3319
for eachi( ~[ 1 , 2 , 3 ] ) |j, v| {
3320
3320
if i == 0 { assert ! ( * v == 1 ) ; }
You can’t perform that action at this time.
0 commit comments