| ... | ... |
@@ -3,6 +3,8 @@ |
| 3 | 3 |
#include <strings.h> |
| 4 | 4 |
#include <stdio.h> |
| 5 | 5 |
|
| 6 |
+#define SCORE_MIN -1 |
|
| 7 |
+ |
|
| 6 | 8 |
static int is_subset(const char *needle, const char *haystack){
|
| 7 | 9 |
while(*needle){
|
| 8 | 10 |
if(!*haystack) |
| ... | ... |
@@ -76,7 +78,7 @@ double match(const char *needle, const char *haystack){
|
| 76 | 78 |
if(!*needle){
|
| 77 | 79 |
return 1.0; |
| 78 | 80 |
}else if(!is_subset(needle, haystack)){
|
| 79 |
- return -1.0; |
|
| 81 |
+ return SCORE_MIN; |
|
| 80 | 82 |
}else if(!strcasecmp(needle, haystack)){
|
| 81 | 83 |
return 1.0; |
| 82 | 84 |
}else{
|