Mercurial > hg > vampy
comparison PyPlugScanner.cpp @ 88:0120dac53a69
d_name can't be NULL; it's an array
author | Chris Cannam |
---|---|
date | Thu, 10 Jan 2019 15:44:39 +0000 |
parents | 6c755f3e1173 |
children | a6718f9fe942 |
comparison
equal
deleted
inserted
replaced
87:39c5f644152d | 88:0120dac53a69 |
---|---|
212 DIR *d = opendir(dir.c_str()); | 212 DIR *d = opendir(dir.c_str()); |
213 if (!d) return files; | 213 if (!d) return files; |
214 | 214 |
215 struct dirent *e = 0; | 215 struct dirent *e = 0; |
216 while ((e = readdir(d))) { | 216 while ((e = readdir(d))) { |
217 | |
218 if (!e->d_name) continue; | |
219 | |
220 size_t len = strlen(e->d_name); | 217 size_t len = strlen(e->d_name); |
221 if (len < extlen + 2 || | 218 if (len < extlen + 2 || |
222 e->d_name + len - extlen - 1 != "." + extension) { | 219 e->d_name + len - extlen - 1 != "." + extension) { |
223 continue; | 220 continue; |
224 } | 221 } |
225 //cerr << "pyscripts: " << e->d_name << endl; | |
226 files.push_back(e->d_name); | 222 files.push_back(e->d_name); |
227 } | 223 } |
228 | 224 |
229 closedir(d); | 225 closedir(d); |
230 #endif | 226 #endif |