suffix_fnc.c

Tue, 20 Sep 2011 15:19:28 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 20 Sep 2011 15:19:28 +0200
changeset 16
bc9a0fefd892
parent 10
ecf787666f44
child 20
43725438ac50
permissions
-rw-r--r--

fixed makefile to run safely on compile errors + added -V option to cline

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

#include "suffix_fnc.h"

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

mercurial