diff options
author | cbdev <cb@cbcdn.com> | 2017-06-08 17:59:08 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2017-06-08 17:59:08 +0200 |
commit | ce46f0e9d232c9469c3626db82633071bc6446dc (patch) | |
tree | 2461d018c00391880f500e38d6bae2143e9a7057 /plugin.c | |
parent | 9bddace1e64c67f18fa6f97fc4e60f01a49c0936 (diff) | |
download | midimonster-ce46f0e9d232c9469c3626db82633071bc6446dc.tar.gz midimonster-ce46f0e9d232c9469c3626db82633071bc6446dc.tar.bz2 midimonster-ce46f0e9d232c9469c3626db82633071bc6446dc.zip |
Only load plugins ending in .so
Diffstat (limited to 'plugin.c')
-rw-r--r-- | plugin.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |