17 } |
17 } |
18 |
18 |
19 bool testSuffix(char* filename, settings_t* settings) { |
19 bool testSuffix(char* filename, settings_t* settings) { |
20 bool ret = false; |
20 bool ret = false; |
21 int tokenlen, fnamelen = strlen(filename); |
21 int tokenlen, fnamelen = strlen(filename); |
22 for (int t = 0 ; t < settings->suffixc ; t++) { |
22 for (int t = 0 ; t < settings->suffixList->count ; t++) { |
23 tokenlen = strlen(settings->suffixv[t]); |
23 tokenlen = strlen(settings->suffixList->items[t]); |
24 if (fnamelen >= tokenlen && tokenlen > 0) { |
24 if (fnamelen >= tokenlen && tokenlen > 0) { |
25 if (strncmp(filename+fnamelen-tokenlen, |
25 if (strncmp(filename+fnamelen-tokenlen, |
26 settings->suffixv[t], tokenlen) == 0) { |
26 settings->suffixList->items[t], tokenlen) == 0) { |
27 ret = true; |
27 ret = true; |
28 break; |
28 break; |
29 } |
29 } |
30 } |
30 } |
31 } |
31 } |