Changeset 2 for trunk/orca/files.c
- Timestamp:
- 01/25/06 14:55:17 (3 years ago)
- Files:
-
- 1 modified
-
trunk/orca/files.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/files.c
r1 r2 248 248 if( a1->type == OT_FILE ) 249 249 { 250 int n; 250 251 const char* fn; 251 252 OString* str = orSTRING(a1); … … 254 255 255 256 fn = str->charArray + a1->series.index; 256 if( orIsDir( fn ) ) 257 n = orIsDir( fn ); 258 if( n < 0 ) 259 { 260 goto read_error; 261 } 262 else if( n == 1 ) 257 263 { 258 264 orReadDir( fn ); … … 280 286 FileHandle fp; 281 287 OString* buf; 282 int n;288 int err; 283 289 int size; 284 290 int skip = 0; … … 323 329 324 330 n = fileRead( fp, buf->buf, size ); 331 err = fileError( fp ); 325 332 fileClose( fp ); 326 333 327 if( n != size)334 if( err ) 328 335 { 336 read_error: 329 337 orErrorT( OR_ERROR_ACCESS, "read failed on %s", fn ); 330 338 return; 331 339 } 332 340 333 buf->used = size;341 buf->used = n; 334 342 orResultSeries( orRefineSet(REF_READ_BINARY) ? 335 343 OT_BINARY : OT_STRING,
