From 7661efbe47193c77026a25e48fead6cc0507a448 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Fri, 1 Jan 2010 20:00:56 +0100 Subject: [PATCH] Fix cc_set --- config.def.h | 1 - zathura.c | 13 +++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config.def.h b/config.def.h index f58036b..dc4ba21 100644 --- a/config.def.h +++ b/config.def.h @@ -107,5 +107,4 @@ SpecialCommand special_commands[] = { Setting settings[] = { /* name, variable, type, render, description */ {"revertvideo", &(Zathura.Global.reverse_video), 'b', TRUE, "Invert the image"}, - {"title", &(Zathura.State.filename), 's', TRUE, "Invert the image"}, }; diff --git a/zathura.c b/zathura.c index 1b94d17..ef93c99 100644 --- a/zathura.c +++ b/zathura.c @@ -1361,19 +1361,20 @@ cc_set(char* input) completion->groups = group; CompletionElement *last_element = NULL; int element_counter = 0; + int i = 0; int input_length = input ? strlen(input) : 0; - for(element_counter = 0; element_counter < LENGTH(settings); element_counter++) + for(i = 0; i < LENGTH(settings); i++) { - if( (input_length <= strlen(settings[element_counter].name)) && - !strncmp(input, settings[element_counter].name, input_length) ) + if( (input_length <= strlen(settings[i].name)) && + !strncmp(input, settings[i].name, input_length) ) { CompletionElement* el = malloc(sizeof(CompletionElement)); - el->value = settings[element_counter].name; - el->description = settings[element_counter].description; + el->value = settings[i].name; + el->description = settings[i].description; el->next = NULL; - if(element_counter != 0) + if(element_counter++ != 0) last_element->next = el; else group->elements = el;