summaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2014-07-15 00:30:35 -0700
committerJohn Hawthorn <john.hawthorn@gmail.com>2014-07-26 20:00:58 -0700
commit017bbd0c5661be48c289575ca543f9e31b499b88 (patch)
tree266cae9616131374f6705862bdc10dbd19ab5a22 /match.c
parentc11190143c5eae88593d271536b9310ce141fe61 (diff)
define SCORE_MIN -1
Diffstat (limited to 'match.c')
-rw-r--r--match.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/match.c b/match.c
index c8af16b..1c4c54b 100644
--- a/match.c
+++ b/match.c
@@ -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{