Changeset 1945


Ignore:
Timestamp:
May 2, 2005, 4:48:50 AM (20 years ago)
Author:
bird
Message:

Fixed bad d_type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/misc/dirent.c

    • Property cvs2svn:cvs-rev changed from 1.8 to 1.9
    r1944 r1945  
    162162    LIBCLOG_ENTER("dirp=%p pdent=%p ppdent=%p\n", (void *)dirp, (void *)pdent, (void *)ppdent);
    163163    int cch;
     164    struct _dircontents *pd;
    164165    /* done? */
    165     if (dirp->dd_cp == NULL)
     166    pd = dirp->dd_cp;
     167    if (pd == NULL)
    166168    {
    167169        //errno = ENOENT;
     
    173175     * Copy the data over to the entry.
    174176     */
    175     cch = strlen(dirp->dd_cp->_d_entry);
    176     memcpy(pdent->d_name, dirp->dd_cp->_d_entry, cch + 1);
     177    cch = strlen(pd->_d_entry);
     178    memcpy(pdent->d_name, pd->_d_entry, cch + 1);
    177179    pdent->d_namlen = cch;
    178180    pdent->d_reclen = pdent->d_namlen;
     
    180182    if (_readdir_ino == 0)
    181183        _readdir_ino = 1;
    182     pdent->d_type = (pdent->d_attr & A_DIR) ? DT_DIR : DT_REG;
    183     pdent->d_size = dirp->dd_cp->_d_size;
    184     pdent->d_attr = dirp->dd_cp->_d_attr;
    185     pdent->d_time = dirp->dd_cp->_d_time;
    186     pdent->d_date = dirp->dd_cp->_d_date;
     184    pdent->d_type = (pd->_d_attr & A_DIR) ? DT_DIR : DT_REG;
     185    pdent->d_size = pd->_d_size;
     186    pdent->d_time = pd->_d_time;
     187    pdent->d_date = pd->_d_date;
     188    pdent->d_attr = pd->_d_attr;
    187189
    188190    /*
    189191     * Advance the stream and return successfully.
    190192     */
    191     dirp->dd_cp = dirp->dd_cp->_d_next;
     193    dirp->dd_cp = pd->_d_next;
    192194    dirp->dd_loc++;
    193195    *ppdent = pdent;
Note: See TracChangeset for help on using the changeset viewer.