Changeset 2 for trunk/orca/files.c

Show
Ignore:
Timestamp:
01/25/06 14:55:17 (3 years ago)
Author:
krobillard
Message:

orca - Fixed read on Windows.
qt - Added append-text native.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/files.c

    r1 r2  
    248248    if( a1->type == OT_FILE ) 
    249249    { 
     250        int n; 
    250251        const char* fn; 
    251252        OString* str = orSTRING(a1); 
     
    254255 
    255256        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 ) 
    257263        { 
    258264            orReadDir( fn ); 
     
    280286                FileHandle fp; 
    281287                OString* buf; 
    282                 int n; 
     288                int err; 
    283289                int size; 
    284290                int skip = 0; 
     
    323329 
    324330                    n = fileRead( fp, buf->buf, size ); 
     331                    err = fileError( fp ); 
    325332                    fileClose( fp ); 
    326333 
    327                     if( n != size ) 
     334                    if( err ) 
    328335                    { 
     336read_error: 
    329337                        orErrorT( OR_ERROR_ACCESS, "read failed on %s", fn ); 
    330338                        return; 
    331339                    } 
    332340 
    333                     buf->used = size; 
     341                    buf->used = n; 
    334342                    orResultSeries( orRefineSet(REF_READ_BINARY) ? 
    335343                                    OT_BINARY : OT_STRING,