diff options
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | plugin.c | 36 |
3 files changed, 21 insertions, 18 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index fc916edc..55a0766c 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3352,6 +3352,7 @@ Dietmar Spingler <d_spingler@gmx.de> CAMs that need to receive the TS for suggesting to add the channel name to log messages that reference a channel for suggesting to provide a way of using no DVB devices at all + for suggesting that the -V and -h options should list the plugins in alphabetical order Stefan Schallenberg <infos@nafets.de> for adding the functions IndexOf(), InsertUnique(), AppendUnique() and RemoveElement() @@ -8633,3 +8633,5 @@ Video Disk Recorder Revision History by time. - The command line option -D now accepts the value '-' (as in -D-), which prevents VDR from using any DVB devices (suggested by Dietmar Spingler). +- The -V and -h options now list the plugins in alphabetical order (suggested by + Dietmar Spingler). @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: plugin.c 2.4 2012/09/01 13:10:27 kls Exp $ + * $Id: plugin.c 4.1 2015/04/18 14:51:20 kls Exp $ */ #include "plugin.h" @@ -318,23 +318,23 @@ void cPluginManager::SetDirectory(const char *Directory) void cPluginManager::AddPlugin(const char *Args) { if (strcmp(Args, "*") == 0) { - cReadDir d(directory); - struct dirent *e; - while ((e = d.Next()) != NULL) { - if (strstr(e->d_name, LIBVDR_PREFIX) == e->d_name) { - char *p = strstr(e->d_name, SO_INDICATOR); - if (p) { - *p = 0; - p += strlen(SO_INDICATOR); - if (strcmp(p, APIVERSION) == 0) { - char *name = e->d_name + strlen(LIBVDR_PREFIX); - if (strcmp(name, "*") != 0) { // let's not get into a loop! - AddPlugin(e->d_name + strlen(LIBVDR_PREFIX)); - } - } - } - } - } + cFileNameList Files(directory); + for (int i = 0; i < Files.Size(); i++) { + char *FileName = Files.At(i); + if (strstr(FileName, LIBVDR_PREFIX) == FileName) { + char *p = strstr(FileName, SO_INDICATOR); + if (p) { + *p = 0; + p += strlen(SO_INDICATOR); + if (strcmp(p, APIVERSION) == 0) { + char *name = FileName + strlen(LIBVDR_PREFIX); + if (strcmp(name, "*") != 0) { // let's not get into a loop! + AddPlugin(FileName + strlen(LIBVDR_PREFIX)); + } + } + } + } + } return; } char *s = strdup(skipspace(Args)); |