aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2017-06-08 17:59:08 +0200
committercbdev <cb@cbcdn.com>2017-06-08 17:59:08 +0200
commitce46f0e9d232c9469c3626db82633071bc6446dc (patch)
tree2461d018c00391880f500e38d6bae2143e9a7057
parent9bddace1e64c67f18fa6f97fc4e60f01a49c0936 (diff)
downloadmidimonster-ce46f0e9d232c9469c3626db82633071bc6446dc.tar.gz
midimonster-ce46f0e9d232c9469c3626db82633071bc6446dc.tar.bz2
midimonster-ce46f0e9d232c9469c3626db82633071bc6446dc.zip
Only load plugins ending in .so
-rw-r--r--README.md9
-rw-r--r--plugin.c4
2 files changed, 10 insertions, 3 deletions
diff --git a/README.md b/README.md
index 4b171e0..7c62452 100644
--- a/README.md
+++ b/README.md
@@ -20,9 +20,12 @@ The configuration is stored in a file with a format very similar to the common
INI file format. A section is started by a header in `[]` braces, followed by
lines of the form `option = value`.
-A section may either be a *backend configuration* section, started by `[backend <backend-name>]`,
-an *instance configuration* section, started by `[<backend-name> <instance-name>]` or a *mapping*
-section started by `[map]`.
+Lines starting with a semicolon are treated as comments and ignored. Inline comments
+are not currently supported.
+
+A configuration section may either be a *backend configuration* section, started by
+`[backend <backend-name>]`, an *instance configuration* section, started by
+`[<backend-name> <instance-name>]` or a *mapping* section started by `[map]`.
The `[map]` section consists of lines of channel-to-channel assignments, reading like
diff --git a/plugin.c b/plugin.c
index 561e131..d2fe95c 100644
--- a/plugin.c
+++ b/plugin.c
@@ -69,6 +69,10 @@ int plugins_load(char* path){
}
for(entry = readdir(directory); entry; entry = readdir(directory)){
+ if(strlen(entry->d_name) < 4 || strncmp(".so", entry->d_name + (strlen(entry->d_name) - 3), 3)){
+ continue;
+ }
+
if(fstatat(dirfd(directory), entry->d_name, &file_stat, 0) < 0){
fprintf(stderr, "Failed to stat %s: %s\n", entry->d_name, strerror(errno));
continue;