aboutsummaryrefslogtreecommitdiffstats
path: root/src/update_walk.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-20 21:01:55 +0200
committerMax Kellermann <max@duempel.org>2009-10-20 21:01:55 +0200
commitc953d6409dffd476370ba639118cba97bcda2f35 (patch)
tree5920d5d03757ae9fd6fd753dcef7532d07bff96b /src/update_walk.c
parent447e4d3583d3394a25f0fb186f50cea45dd7f797 (diff)
downloadmpd-c953d6409dffd476370ba639118cba97bcda2f35.tar.gz
mpd-c953d6409dffd476370ba639118cba97bcda2f35.tar.xz
mpd-c953d6409dffd476370ba639118cba97bcda2f35.zip
mapper, update, ...: use g_build_filename(), G_DIR_SEPARATOR, ...
Try to be as portable as possible, use GLib path name functions and macros.
Diffstat (limited to 'src/update_walk.c')
-rw-r--r--src/update_walk.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/update_walk.c b/src/update_walk.c
index bf6b0ef15..fe99ea32a 100644
--- a/src/update_walk.c
+++ b/src/update_walk.c
@@ -620,7 +620,7 @@ skip_symlink(const struct directory *directory, const char *utf8_name)
p = buffer;
while (*p == '.') {
- if (p[1] == '.' && p[2] == '/') {
+ if (p[1] == '.' && G_IS_DIR_SEPARATOR(p[2])) {
/* "../" moves to parent directory */
directory = directory->parent;
if (directory == NULL) {
@@ -630,7 +630,7 @@ skip_symlink(const struct directory *directory, const char *utf8_name)
return !follow_outside_symlinks;
}
p += 3;
- } else if (p[1] == '/')
+ } else if (G_IS_DIR_SEPARATOR(p[1]))
/* eliminate "./" */
p += 2;
else
@@ -675,8 +675,7 @@ updateDirectory(struct directory *directory, const struct stat *st)
return false;
}
- exclude_path_fs = g_strconcat(path_fs, G_DIR_SEPARATOR_S,
- ".mpdignore", NULL);
+ exclude_path_fs = g_build_filename(path_fs, ".mpdignore", NULL);
exclude_list = exclude_list_load(exclude_path_fs);
g_free(exclude_path_fs);