aboutsummaryrefslogtreecommitdiffstats
path: root/src/update.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-15 20:51:01 +0200
committerMax Kellermann <max@duempel.org>2008-10-15 20:51:01 +0200
commitfa56ff3d5250219d39d3cb077fd1e265fd6f92be (patch)
treeb06586c3894e678c2f9b2d2337b78f6def794fe4 /src/update.c
parent92513c3309b1cd01633e1f359eb03a679c884e0d (diff)
downloadmpd-fa56ff3d5250219d39d3cb077fd1e265fd6f92be.tar.gz
mpd-fa56ff3d5250219d39d3cb077fd1e265fd6f92be.tar.xz
mpd-fa56ff3d5250219d39d3cb077fd1e265fd6f92be.zip
update: don't skip hidden files
Skip only the special directory entries "." and "..", don't skip all other "hidden" files.
Diffstat (limited to 'src/update.c')
-rw-r--r--src/update.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/update.c b/src/update.c
index 4017842b9..58a55cf9c 100644
--- a/src/update.c
+++ b/src/update.c
@@ -307,10 +307,12 @@ updateInDirectory(struct directory *directory,
}
}
-/* we don't look at hidden files nor files with newlines in them */
-static int skip_path(const char *path)
+/* we don't look at "." / ".." nor files with newlines in their name */
+static bool skip_path(const char *path)
{
- return (path[0] == '.' || strchr(path, '\n')) ? 1 : 0;
+ return (path[0] == '.' && path[1] == 0) ||
+ (path[0] == '.' && path[1] == '.' && path[2] == 0) ||
+ strchr(path, '\n') != NULL;
}
static bool