author | Michael Krelin <hacker@klever.net> | 2011-08-30 20:52:04 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2011-08-30 20:52:04 (UTC) |
commit | 55bdd80087710b94e747a622fad8bd0ee3e3dec3 (patch) (side-by-side diff) | |
tree | 6d4b8ab76b18c7f6e3d6d2823470c8662cbdf8f5 | |
parent | 77706495aa0cc1706cfe1535b40477e004312081 (diff) | |
download | iii-55bdd80087710b94e747a622fad8bd0ee3e3dec3.zip iii-55bdd80087710b94e747a622fad8bd0ee3e3dec3.tar.gz iii-55bdd80087710b94e747a622fad8bd0ee3e3dec3.tar.bz2 |
updated list of supported suffixes
Signed-off-by: Michael Krelin <hacker@klever.net>
-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 @@ -4,4 +4,5 @@ #include <stdexcept> #include <iterator> +#include <algorithm> #include <syslog.h> #include <sys/wait.h> @@ -169,5 +170,8 @@ int eyefiService::UploadPhoto( if(fl<4) continue; 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; else if(!strcasecmp(s,".log")) |