respect return code from glob()

This commit is contained in:
David Rose 2004-02-02 21:42:09 +00:00
parent fae44c3315
commit e3ab4966cf
2 changed files with 8 additions and 0 deletions

View File

@ -1172,6 +1172,10 @@ scan_directory(vector_string &contents) const {
glob_t globbuf;
int r = glob(dirname.c_str(), GLOB_ERR, NULL, &globbuf);
if (r != 0 && r != GLOB_NOMATCH) {
perror(dirname.c_str());
return false;
}
size_t offset = dirname.size() - 1;
for (int i = 0; globbuf.gl_pathv[i] != NULL; i++) {

View File

@ -1172,6 +1172,10 @@ scan_directory(vector_string &contents) const {
glob_t globbuf;
int r = glob(dirname.c_str(), GLOB_ERR, NULL, &globbuf);
if (r != 0 && r != GLOB_NOMATCH) {
perror(dirname.c_str());
return false;
}
size_t offset = dirname.size() - 1;
for (int i = 0; globbuf.gl_pathv[i] != NULL; i++) {