mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 06:26:01 +01:00
Fix cc_set
This commit is contained in:
parent
e2b72b4a1d
commit
7661efbe47
2 changed files with 7 additions and 7 deletions
|
@ -107,5 +107,4 @@ SpecialCommand special_commands[] = {
|
||||||
Setting settings[] = {
|
Setting settings[] = {
|
||||||
/* name, variable, type, render, description */
|
/* name, variable, type, render, description */
|
||||||
{"revertvideo", &(Zathura.Global.reverse_video), 'b', TRUE, "Invert the image"},
|
{"revertvideo", &(Zathura.Global.reverse_video), 'b', TRUE, "Invert the image"},
|
||||||
{"title", &(Zathura.State.filename), 's', TRUE, "Invert the image"},
|
|
||||||
};
|
};
|
||||||
|
|
13
zathura.c
13
zathura.c
|
@ -1361,19 +1361,20 @@ cc_set(char* input)
|
||||||
completion->groups = group;
|
completion->groups = group;
|
||||||
CompletionElement *last_element = NULL;
|
CompletionElement *last_element = NULL;
|
||||||
int element_counter = 0;
|
int element_counter = 0;
|
||||||
|
int i = 0;
|
||||||
int input_length = input ? strlen(input) : 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)) &&
|
if( (input_length <= strlen(settings[i].name)) &&
|
||||||
!strncmp(input, settings[element_counter].name, input_length) )
|
!strncmp(input, settings[i].name, input_length) )
|
||||||
{
|
{
|
||||||
CompletionElement* el = malloc(sizeof(CompletionElement));
|
CompletionElement* el = malloc(sizeof(CompletionElement));
|
||||||
el->value = settings[element_counter].name;
|
el->value = settings[i].name;
|
||||||
el->description = settings[element_counter].description;
|
el->description = settings[i].description;
|
||||||
el->next = NULL;
|
el->next = NULL;
|
||||||
|
|
||||||
if(element_counter != 0)
|
if(element_counter++ != 0)
|
||||||
last_element->next = el;
|
last_element->next = el;
|
||||||
else
|
else
|
||||||
group->elements = el;
|
group->elements = el;
|
||||||
|
|
Loading…
Reference in a new issue