Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8225 in orxonox.OLD


Ignore:
Timestamp:
Jun 8, 2006, 10:32:45 AM (18 years ago)
Author:
bensch
Message:

gui: directory should be safe now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/util/directory.cc

    r8224 r8225  
    6868#if not defined(__WIN32__)
    6969  DIR* handle;
    70   if (handle != NULL)
    71     this->close();
    7270  handle = opendir(this->name().c_str());
    7371  if (!handle)
     
    7876#else
    7977  HANDLE handle;
    80   if (handle != INVALID_HANDLE_VALUE)
    81     this->close();
    8278
    8379  // First check the attributes trying to access a non-Directory with
     
    107103  // BUILDING the list of contained Files. (only the names)
    108104#if not defined(__WIN32__)
    109   while (dirent* entry = readdir(handle))
     105  dirent* entry;
     106  while ((entry = readdir(handle)) != NULL)
    110107    this->_fileNames.push_back(entry->d_name);
    111108  closedir(handle);
    112109#else
    113110  WIN32_FIND_DATA entry;
    114   while (int ok = FindNextFile(handle, &entry))
     111  while ((int ok = FindNextFile(handle, &entry)) != 0)
    115112    this->_fileNames.push_back(entry.cFileName);
    116113  FindClose(handle);
Note: See TracChangeset for help on using the changeset viewer.