mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-26 21:56:03 +01:00
fix double free, make page index 1-based
This commit is contained in:
parent
6d4708937e
commit
0ea99dff36
2 changed files with 2 additions and 4 deletions
|
@ -536,7 +536,7 @@ cmd_exec(girara_session_t* session, girara_list_t* argument_list)
|
|||
const char* path = zathura_document_get_path(zathura->document);
|
||||
unsigned int page = zathura_document_get_current_page_number(zathura->document);
|
||||
char page_buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
g_ascii_dtostr(page_buf, G_ASCII_DTOSTR_BUF_SIZE, page);
|
||||
g_ascii_dtostr(page_buf, G_ASCII_DTOSTR_BUF_SIZE, page+1);
|
||||
|
||||
GIRARA_LIST_FOREACH_BODY_WITH_ITER(argument_list, char*, iter, value,
|
||||
char* r = girara_replace_substring(value, "$FILE", path);
|
||||
|
@ -550,8 +550,6 @@ cmd_exec(girara_session_t* session, girara_list_t* argument_list)
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
g_free(page_buf);
|
||||
}
|
||||
|
||||
return girara_exec_with_argument_list(session, argument_list);
|
||||
|
|
|
@ -1471,7 +1471,7 @@ sc_exec(girara_session_t* session, girara_argument_t* argument, girara_event_t*
|
|||
const char* path = zathura_document_get_path(zathura->document);
|
||||
unsigned int page = zathura_document_get_current_page_number(zathura->document);
|
||||
char page_buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
g_ascii_dtostr(page_buf, G_ASCII_DTOSTR_BUF_SIZE, page);
|
||||
g_ascii_dtostr(page_buf, G_ASCII_DTOSTR_BUF_SIZE, page+1);
|
||||
|
||||
girara_argument_t new_argument = *argument;
|
||||
|
||||
|
|
Loading…
Reference in a new issue