mirror of https://github.com/djcb/mu.git
* mu-path: fix the direntries to ignore, add some comments
This commit is contained in:
parent
41e910b7ff
commit
9a55927767
|
@ -107,8 +107,10 @@ static gboolean
|
||||||
has_noindex_file (const char *path)
|
has_noindex_file (const char *path)
|
||||||
{
|
{
|
||||||
char *fname;
|
char *fname;
|
||||||
|
|
||||||
fname = g_newa (char, strlen(path) + 1 + strlen(MU_PATH_NOINDEX_FILE) + 1);
|
fname = g_newa (char, strlen(path) + 1 + strlen(MU_PATH_NOINDEX_FILE) + 1);
|
||||||
sprintf (fname, "%s%c%s", path, G_DIR_SEPARATOR, MU_PATH_NOINDEX_FILE);
|
sprintf (fname, "%s%c%s", path, G_DIR_SEPARATOR, MU_PATH_NOINDEX_FILE);
|
||||||
|
|
||||||
if (access (fname, F_OK) == 0)
|
if (access (fname, F_OK) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else if (errno != ENOENT)
|
else if (errno != ENOENT)
|
||||||
|
@ -122,8 +124,14 @@ _ignore_dir_entry (struct dirent *entry)
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
if (entry->d_type!= DT_REG)
|
/* if it's not a dir and not a file, ignore it.
|
||||||
return FALSE;
|
* note, this means also symlinks (DT_LNK) are ignored,
|
||||||
|
* maybe make this optional. Also note that entry->d_type is
|
||||||
|
* defined on Linux, BSDs is not part of POSIX; this needs a
|
||||||
|
* configure check */
|
||||||
|
if (entry->d_type != DT_REG &&
|
||||||
|
entry->d_type != DT_DIR)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
name = entry->d_name;
|
name = entry->d_name;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue