#include <stdio.h>
#include <errno.h>
#include <limits.h>
-#include <libgen.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
}
else
{ /* base relative paths to the directory of the current file */
- char *path = strdup(file);
- char *dir = dirname(path);
+ char *dir = path_dirname(file);
if (snprintf(pat, sizeof(pat), "%s/%s", dir, pattern) >= sizeof(pat))
{
DBG1(DBG_LIB, "include pattern too long, ignored");
- free(path);
+ free(dir);
return TRUE;
}
- free(path);
+ free(dir);
}
#ifdef HAVE_GLOB_H
{