Change Details
src/filelister.cpp |
83 | 83 | directories.clear(); |
84 | 84 | files.clear(); |
85 | 85 | |
86 | | DIR *dirp; |
87 | 86 | string slashedPath = path; |
88 | 87 | if (path[path.length() - 1] != '/') |
89 | 88 | slashedPath.push_back('/'); |
90 | 89 | |
| 90 | DIR *dirp; |
91 | 91 | if ((dirp = opendir(slashedPath.c_str())) == NULL) { |
92 | 92 | ERROR("Unable to open directory: %s\n", slashedPath.c_str()); |
93 | 93 | return; |
94 | 94 | } |
95 | 95 | |
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; |
102 | 98 | |
103 | 99 | if (file[0] == '.' && file != "..") |
104 | 100 | continue; |
105 | 101 | |
106 | | filepath = slashedPath + file; |
| 102 | string filepath = slashedPath + file; |
| 103 | struct stat st; |
107 | 104 | int statRet = stat(filepath.c_str(), &st); |
108 | 105 | if (statRet == -1) { |
109 | 106 | ERROR("Stat failed on '%s' with error '%s'\n", filepath.c_str(), strerror(errno)); |
Download the corresponding diff file