Opened 9 years ago

Closed 9 years ago

#5535 closed defect (fixed)

VSIReadDirRecursive recurses forever

Reported by: Kurt Schwehr Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords: port, vsi

Description (last modified by Kurt Schwehr)

I'm seeing VSIReadDirRecursive recurse forever in a small test program pointing to a directory. It appears to be walking "." and ".." and thus heading for trouble.


Proposed fix:

  • cpl_vsil.cpp

    131131        for ( ; i < nCount; i++ )
    132132        {
     133            // Do not recurse up the tree.
     134            // TODO(schwehr): Is this portable to all filesystems?
     135            if (EQUAL(".", papszFiles[i]) || EQUAL("..", papszFiles[i]))
     136              continue;
    133138            // build complete file name for stat
    134139            osTemp1.clear();
    135140            osTemp1.append( pszPath );

Change History (2)

comment:1 by Kurt Schwehr, 9 years ago

Description: modified (diff)

comment:2 by Even Rouault, 9 years ago

Resolution: fixed
Status: newclosed

Committed in trunk r27468

Note: See TracTickets for help on using tickets.