From 0e095c1a24b4c23aa9fab9c624af544dfb53fe63 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 3 Apr 2016 20:38:51 +0200 Subject: [PATCH] Use the last value for all unspecified pages per row This change ensures that configs with "first-page-column=2" before 0.3.4 will upgrade more sanely. Signed-off-by: Sebastian Ramacher --- doc/man/zathurarc.5.rst | 7 +++++-- zathura/utils.c | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/man/zathurarc.5.rst b/doc/man/zathurarc.5.rst index c70f524..523ce8a 100644 --- a/doc/man/zathurarc.5.rst +++ b/doc/man/zathurarc.5.rst @@ -739,8 +739,11 @@ first-page-column ^^^^^^^^^^^^^^^^^ Defines the column in which the first page will be displayed. This setting is stored separately for every value of pages-per-row according to -the following pattern <1 page per row>:[<2 pages per row>[: ...]]. Per default, -the first column is set to 2 for double-page layout. +the following pattern <1 page per row>:[<2 pages per row>[: ...]]. The last +value in the list will be used for all other number of pages per row if not set +explicitely. + +Per default, the first column is set to 2 for double-page layout. * Value type: String * Default value: 1:2 diff --git a/zathura/utils.c b/zathura/utils.c index bf394fa..5fdf042 100644 --- a/zathura/utils.c +++ b/zathura/utils.c @@ -269,6 +269,8 @@ find_first_page_column(const char* first_page_column_list, unsigned int index = pages_per_row - 1; if (index < settings_size && *settings[index] != '\0') { first_page_column = atoi(settings[index]); + } else if (*settings[settings_size - 1] != '\0') { + first_page_column = atoi(settings[settings_size - 1]); } /* free buffers */