1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

[SSH] Match lowered keywords.

Fixes issue: #954
This commit is contained in:
Dave Davenport 2019-04-24 21:59:36 +02:00
parent 2a93daec04
commit 4707927031

View file

@ -362,8 +362,8 @@ static void parse_ssh_config_file ( SSHModePrivateData *pd, const char *filename
if ( !token || *token == '#' ) {
continue;
}
if ( g_strcmp0 ( token, "Include" ) == 0 ) {
char *low_token = g_ascii_strdown(token, -1);
if ( g_strcmp0 ( low_token, "include" ) == 0 ) {
token = strtok_r ( NULL, SSH_TOKEN_DELIM, &strtok_pointer );
g_debug ( "Found Include: %s", token );
gchar *path = rofi_expand_path ( token );
@ -388,13 +388,13 @@ static void parse_ssh_config_file ( SSHModePrivateData *pd, const char *filename
g_free ( full_path );
g_free ( path );
}
else if ( g_strcmp0 ( token, "UserKnownHostsFile" ) == 0 ) {
else if ( g_strcmp0 ( low_token, "userknownhostsfile" ) == 0 ) {
while ( ( token = strtok_r ( NULL, SSH_TOKEN_DELIM, &strtok_pointer ) ) ) {
g_debug("Found extra UserKnownHostsFile: %s", token);
add_known_hosts_file ( pd, token );
}
}
else if ( g_strcmp0 ( token, "Host" ) == 0 ) {
else if ( g_strcmp0 ( low_token, "host" ) == 0 ) {
// Now we know that this is a "Host" line.
// The "Host" keyword is followed by one more host names separated
// by whitespace; while host names may be quoted with double quotes
@ -434,6 +434,7 @@ static void parse_ssh_config_file ( SSHModePrivateData *pd, const char *filename
( *length )++;
}
}
g_free ( low_token );
}
if ( buffer != NULL ) {
free ( buffer );