summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-29 00:13:48 +0200
committerwm4 <wm4@nowhere>2015-07-29 00:13:48 +0200
commit15f97f05b9f118afca39199da87e3fd9f78c1ee1 (patch)
treeab61645448e5af77d91b150f89bf01ece2c84d96
parentf2bba55e015f572993fa6d2f9c19fa9c623888b9 (diff)
downloadmpv-15f97f05b9f118afca39199da87e3fd9f78c1ee1.tar.bz2
mpv-15f97f05b9f118afca39199da87e3fd9f78c1ee1.tar.xz
demux_playlist: skip hidden directories
The user probably doesn't want these. Conveniently, this also skips the unwanted "." and ".." entries. (This code is triggered if the input stream is a directory - and it's in demux_playlist.c because it's convenient.)
-rw-r--r--demux/demux_playlist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/demux/demux_playlist.c b/demux/demux_playlist.c
index 0afda57c6a..ff252bb417 100644
--- a/demux/demux_playlist.c
+++ b/demux/demux_playlist.c
@@ -250,7 +250,7 @@ static int parse_dir(struct pl_parser *p)
struct dirent *ep;
while ((ep = readdir(dp))) {
- if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0)
+ if (ep->d_name[0] == '.')
continue;
MP_TARRAY_APPEND(p, files, num_files, talloc_strdup(p, ep->d_name));
}