1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-07-31 21:59:25 -04:00

Small fix

This commit is contained in:
Dave Davenport 2015-11-17 16:21:30 +01:00
parent aeaceb154a
commit 00c8439b57

View file

@ -207,9 +207,9 @@ char **tokenize ( const char *input, int case_sensitive )
for ( token = strtok_r ( str, " ", &saveptr ); token != NULL; token = strtok_r ( NULL, " ", &saveptr ) ) {
retv = g_realloc ( retv, sizeof ( char* ) * ( num_tokens + 2 ) );
if ( config.glob ) {
char *t = token_collate_key ( token, case_sensitive );
char *str = g_strdup_printf ( "*%s*", input );
retv[num_tokens] = (char *) g_pattern_spec_new ( str );
char *str = g_strdup_printf ( "*%s*", token);
char *t = token_collate_key ( str, case_sensitive );
retv[num_tokens] = (char *) g_pattern_spec_new ( t );
g_free ( t );
g_free ( str );
}
@ -459,7 +459,7 @@ static int regex_token_match ( char **tokens, const char *input, G_GNUC_UNUSED i
static int glob_token_match ( char **tokens, const char *input, int not_ascii, int case_sensitive )
{
int match = 1;
char *compk = not_ascii ? token_collate_key ( input, case_sensitive ) : (char *) input;
char *compk = not_ascii ? token_collate_key ( input, case_sensitive ) : g_ascii_strdown(input,-1);
// Do a tokenized match.
if ( tokens ) {
@ -467,9 +467,7 @@ static int glob_token_match ( char **tokens, const char *input, int not_ascii, i
match = g_pattern_match_string ( (GPatternSpec *) tokens[j], compk );
}
}
if ( not_ascii ) {
g_free ( compk );
}
return match;
}