aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/config.c b/src/config.c
index 6435f860..5d1baa51 100644
--- a/src/config.c
+++ b/src/config.c
@@ -406,7 +406,7 @@ static int ssh_config_parse_line(ssh_session session, const char *line,
}
break;
case SOC_HOST: {
- int ok = 0;
+ int ok = 0, result = -1;
*parsing = 0;
lowerhost = (session->opts.host) ? ssh_lowercase(session->opts.host) : NULL;
@@ -415,14 +415,17 @@ static int ssh_config_parse_line(ssh_session session, const char *line,
p = ssh_config_get_str_tok(&s, NULL)) {
if (ok >= 0) {
ok = match_hostname(lowerhost, p, strlen(p));
- if (ok < 0) {
- *parsing = 0;
- } else if (ok > 0) {
- *parsing = 1;
+ if (result == -1 && ok < 0) {
+ result = 0;
+ } else if (result == -1 && ok > 0) {
+ result = 1;
}
}
}
SAFE_FREE(lowerhost);
+ if (result != -1) {
+ *parsing = result;
+ }
break;
}
case SOC_HOSTNAME: