Date:2014-08-13 07:14:30 (9 years 7 months ago)
Author:Maarten ter Huurne
Commit:90a5f82b92d71fbae74e68a96abf144910085018
Message:In FileLister::browse, declare variables when they are needed

Files: src/filelister.cpp (1 diff)

Change Details

src/filelister.cpp
8383    directories.clear();
8484    files.clear();
8585
86    DIR *dirp;
8786    string slashedPath = path;
8887    if (path[path.length() - 1] != '/')
8988        slashedPath.push_back('/');
9089
90    DIR *dirp;
9191    if ((dirp = opendir(slashedPath.c_str())) == NULL) {
9292        ERROR("Unable to open directory: %s\n", slashedPath.c_str());
9393        return;
9494    }
9595
96    string filepath, file;
97    struct stat st;
98    struct dirent *dptr;
99
100    while ((dptr = readdir(dirp))) {
101        file = dptr->d_name;
96    while (struct dirent *dptr = readdir(dirp)) {
97        string file = dptr->d_name;
10298
10399        if (file[0] == '.' && file != "..")
104100            continue;
105101
106        filepath = slashedPath + file;
102        string filepath = slashedPath + file;
103        struct stat st;
107104        int statRet = stat(filepath.c_str(), &st);
108105        if (statRet == -1) {
109106            ERROR("Stat failed on '%s' with error '%s'\n", filepath.c_str(), strerror(errno));

Archive Download the corresponding diff file



interactive