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) {
}
if (strcmp (name, ".") == 0) {
- prefix = getcpy ("");
+ prefix = mh_xstrdup("");
} else {
prefix = concat (name, "/", (void *)NULL);
}
void
crawl_folders (char *dir, crawl_callback_t *callback, void *baton)
{
- struct crawl_context *crawl = mh_xmalloc (sizeof(*crawl));
+ struct crawl_context *crawl;
+ NEW(crawl);
crawl->max = CRAWL_NUMFOLDERS;
crawl->total = crawl->start = crawl->foldp = 0;
crawl->folders = mh_xmalloc (crawl->max * sizeof(*crawl->folders));