diff options
author | John Hawthorn <john.hawthorn@gmail.com> | 2014-07-15 00:30:35 -0700 |
---|---|---|
committer | John Hawthorn <john.hawthorn@gmail.com> | 2014-07-26 20:00:58 -0700 |
commit | 017bbd0c5661be48c289575ca543f9e31b499b88 (patch) | |
tree | 266cae9616131374f6705862bdc10dbd19ab5a22 /match.c | |
parent | c11190143c5eae88593d271536b9310ce141fe61 (diff) |
define SCORE_MIN -1
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3,6 +3,8 @@ #include <strings.h> #include <stdio.h> +#define SCORE_MIN -1 + static int is_subset(const char *needle, const char *haystack){ while(*needle){ if(!*haystack) @@ -76,7 +78,7 @@ double match(const char *needle, const char *haystack){ if(!*needle){ return 1.0; }else if(!is_subset(needle, haystack)){ - return -1.0; + return SCORE_MIN; }else if(!strcasecmp(needle, haystack)){ return 1.0; }else{ |