diff options
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | RCSID("$Id: match.c,v 1.5 2000/04/16 01:18:43 damien Exp $"); | 17 | RCSID("$Id: match.c,v 1.6 2000/06/07 09:55:44 djm Exp $"); |
18 | 18 | ||
19 | #include "ssh.h" | 19 | #include "ssh.h" |
20 | 20 | ||
@@ -84,8 +84,8 @@ match_pattern(const char *s, const char *pattern) | |||
84 | /* | 84 | /* |
85 | * Tries to match the host name (which must be in all lowercase) against the | 85 | * Tries to match the host name (which must be in all lowercase) against the |
86 | * comma-separated sequence of subpatterns (each possibly preceded by ! to | 86 | * comma-separated sequence of subpatterns (each possibly preceded by ! to |
87 | * indicate negation). Returns true if there is a positive match; zero | 87 | * indicate negation). Returns -1 if negation matches, 1 if there is |
88 | * otherwise. | 88 | * a positive match, 0 if there is no match at all. |
89 | */ | 89 | */ |
90 | 90 | ||
91 | int | 91 | int |
@@ -127,15 +127,15 @@ match_hostname(const char *host, const char *pattern, unsigned int len) | |||
127 | /* Try to match the subpattern against the host name. */ | 127 | /* Try to match the subpattern against the host name. */ |
128 | if (match_pattern(host, sub)) { | 128 | if (match_pattern(host, sub)) { |
129 | if (negated) | 129 | if (negated) |
130 | return 0; /* Fail */ | 130 | return -1; /* Negative */ |
131 | else | 131 | else |
132 | got_positive = 1; | 132 | got_positive = 1; /* Positive */ |
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | /* | 136 | /* |
137 | * Return success if got a positive match. If there was a negative | 137 | * Return success if got a positive match. If there was a negative |
138 | * match, we have already returned zero and never get here. | 138 | * match, we have already returned -1 and never get here. |
139 | */ | 139 | */ |
140 | return got_positive; | 140 | return got_positive; |
141 | } | 141 | } |