-rw-r--r-- | src/eyefiservice.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/eyefiservice.cc b/src/eyefiservice.cc index d7f0f04..77526b9 100644 --- a/src/eyefiservice.cc +++ b/src/eyefiservice.cc @@ -5,2 +5,3 @@ #include <iterator> +#include <algorithm> #include <syslog.h> @@ -170,3 +171,6 @@ int eyefiService::UploadPhoto( const char *s = f.c_str()+fl-4; - if(!(strcasecmp(s,".JPG") && strcasecmp(s,".AVI"))) + static const char *suffixes[] = { ".JPG",".AVI",".MP4",".NEF",".RAW",".TIF" }; + if(std::find_if(suffixes,suffixes+sizeof(suffixes)/sizeof(*suffixes), + std::not1(std::bind1st(std::ptr_fun(strcasecmp),s))) + != suffixes+sizeof(suffixes)/sizeof(*suffixes)) tf = f; |