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

/*
 * suffix_fnc.c
 *
 *  Created on: 15.09.2011
 *      Author: Mike
 */

#include "suffix_fnc.h"

bool testSuffix(char* filename, string_list_t* list) {
  bool ret = false;
  int tokenlen, fnamelen = strlen(filename);
  for (int t = 0 ; t < list->count ; t++) {
    tokenlen = strlen(list->items[t]);
    if (fnamelen >= tokenlen && tokenlen > 0) {
      if (strncmp(filename+fnamelen-tokenlen,
                  list->items[t], tokenlen) == 0) {
        ret = true;
        break;
      }
    }
  }
  return ret;
}

mercurial