From 15f97f05b9f118afca39199da87e3fd9f78c1ee1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 29 Jul 2015 00:13:48 +0200 Subject: 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.) --- demux/demux_playlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); } -- cgit v1.2.3