#include <h/mh.h>
#include <h/crawl_folders.h>
#include <h/utils.h>
+#include <dirent.h>
+#include <sys/stat.h>
struct crawl_context {
int max; /*
- ** how many folders we currently can hold in the array
- ** `folders', increased by CRAWL_NUMFOLDERS at a time
+ ** number of folders we can hold in the folders array;
+ ** increased by CRAWL_NUMFOLDERS at a time
*/
int total; /* how many `folders' actually has */
char **folders; /* the array of folders */
static void
add_folder(char *fold, struct crawl_context *crawl)
{
- register int i, j;
+ int i, j;
/* if necessary, reallocate the space for folder names */
if (crawl->foldp >= crawl->max) {
continue;
}
#endif
- if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) {
+ if (strcmp(dp->d_name, ".")==0 ||
+ strcmp(dp->d_name, "..")==0) {
continue;
}
child = concat(prefix, dp->d_name, (void *)NULL);