summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2015-04-18 14:55:16 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2015-04-18 14:55:16 +0200
commit165aa63d2e0463c5a186b8f6a0e6af5a74707dbe (patch)
treeb3b96739aa9409c31fc7307f94b39b9b0f43df62
parentfa701228d76e329161f84057c7bb5693026c3fa3 (diff)
downloadvdr-165aa63d2e0463c5a186b8f6a0e6af5a74707dbe.tar.gz
vdr-165aa63d2e0463c5a186b8f6a0e6af5a74707dbe.tar.bz2
The -V and -h options now list the plugins in alphabetical order
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY2
-rw-r--r--plugin.c36
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()
diff --git a/HISTORY b/HISTORY
index 6f725f6a..467c531d 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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).
diff --git a/plugin.c b/plugin.c
index db16d080..223d709d 100644
--- a/plugin.c
+++ b/plugin.c
@@ -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));