Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Langhoff <martin@laptop.org>2012-09-21 03:30:52 (GMT)
committer Simon Schampijer <simon@laptop.org>2012-11-07 07:21:03 (GMT)
commit582fbccac150eb19ee6e3c5191e2b4df50af53bb (patch)
tree4119659a6e886dbb8437ff737ac2506b4d5df9ea
parent0869854f993e7d36ef85fedee8ed9b60a92ea28e (diff)
metadatareader: ignore ".hidden" files
Ignore any file with a filename starting with a '.' -- metadatastore writes its tempfiles prefixed with a '.' . Signed-off-by: Martin Langhoff <martin@laptop.org> Tested-by: Samuel Greenfeld <greenfeld@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
-rw-r--r--src/carquinyol/metadatareader.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/carquinyol/metadatareader.c b/src/carquinyol/metadatareader.c
index d053a22..ee546f3 100644
--- a/src/carquinyol/metadatareader.c
+++ b/src/carquinyol/metadatareader.c
@@ -161,11 +161,8 @@ static PyObject *read_all_properties (const char *metadata_path) {
dir_entry = readdir (dir_stream);
while (dir_entry != NULL) {
- // Skip . and ..
- if (dir_entry->d_name[0] == '.' &&
- (strlen (dir_entry->d_name) == 1 ||
- (dir_entry->d_name[1] == '.' &&
- strlen (dir_entry->d_name) == 2)))
+ // Skip '.', '..', and any .hidden file
+ if (dir_entry->d_name[0] == '.')
goto next_property;
if (add_property (metadata_path, dir_entry->d_name, dict, 1) == 0)