struct nond_on_fs {
int len;
- char name[0];
+ char name[FLEX_ARRAY]; /* more */
};
static struct nond_on_fs **dir;
if (pos >= 0)
return 1;
pos = -pos-1;
- if (pos >= active_nr)
+ if (pos >= active_nr) /* can't */
return 0;
- if (strncmp(active_cache[pos]->name, dirname, len))
- return 0;
- return active_cache[pos]->name[len] == '/';
+ return !strncmp(active_cache[pos]->name, dirname, len);
}
/*
continue;
/* fallthrough */
case DT_DIR:
- if (show_other_directories) {
- if (!dir_exists(fullname, baselen + len))
- break;
- }
memcpy(fullname + baselen + len, "/", 2);
+ len++;
+ if (show_other_directories &&
+ !dir_exists(fullname, baselen + len))
+ break;
read_directory(fullname, fullname,
- baselen + len + 1);
+ baselen + len);
continue;
case DT_REG:
case DT_LNK: