suffix_fnc.c

Tue, 02 Oct 2012 10:49:25 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 02 Oct 2012 10:49:25 +0200
changeset 33
1a2d7298bc82
parent 30
d642fdb6745e
permissions
-rw-r--r--

added multi-directory support

fixed parser bug in directory parser locking argument number 1024

fixed freed memory access on settings structure

     1 /*
     2  * suffix_fnc.c
     3  *
     4  *  Created on: 15.09.2011
     5  *      Author: Mike
     6  */
     8 #include "suffix_fnc.h"
    10 bool testSuffix(char* filename, string_list_t* list) {
    11   bool ret = false;
    12   int tokenlen, fnamelen = strlen(filename);
    13   for (int t = 0 ; t < list->count ; t++) {
    14     tokenlen = strlen(list->items[t]);
    15     if (fnamelen >= tokenlen && tokenlen > 0) {
    16       if (strncmp(filename+fnamelen-tokenlen,
    17                   list->items[t], tokenlen) == 0) {
    18         ret = true;
    19         break;
    20       }
    21     }
    22   }
    23   return ret;
    24 }

mercurial