summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--src/eyefiservice.cc6
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
@@ -3,6 +3,7 @@
3#include <fstream> 3#include <fstream>
4#include <stdexcept> 4#include <stdexcept>
5#include <iterator> 5#include <iterator>
6#include <algorithm>
6#include <syslog.h> 7#include <syslog.h>
7#include <sys/wait.h> 8#include <sys/wait.h>
8#include <autosprintf.h> 9#include <autosprintf.h>
@@ -168,7 +169,10 @@ int eyefiService::UploadPhoto(
168 std::string::size_type fl = f.length(); 169 std::string::size_type fl = f.length();
169 if(fl<4) continue; 170 if(fl<4) continue;
170 const char *s = f.c_str()+fl-4; 171 const char *s = f.c_str()+fl-4;
171 if(!(strcasecmp(s,".JPG") && strcasecmp(s,".AVI"))) 172 static const char *suffixes[] = { ".JPG",".AVI",".MP4",".NEF",".RAW",".TIF" };
173 if(std::find_if(suffixes,suffixes+sizeof(suffixes)/sizeof(*suffixes),
174 std::not1(std::bind1st(std::ptr_fun(strcasecmp),s)))
175 != suffixes+sizeof(suffixes)/sizeof(*suffixes))
172 tf = f; 176 tf = f;
173 else if(!strcasecmp(s,".log")) 177 else if(!strcasecmp(s,".log"))
174 lf = f; 178 lf = f;