Skip to content

Commit

Permalink
Fix option parsing for options that are handled by a callback
Browse files Browse the repository at this point in the history
Cherry-picked from master on top of 2.3.4.
  • Loading branch information
phillipberndt committed Apr 22, 2015
1 parent 0b3e056 commit 236bda1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ Known bugs
Changelog
---------

pqiv 2.3.5
* Fix parameters in pqivrc that are handled by a callback

pqiv 2.3.4
* Fix reference counting if an image fails to load

pqiv 2.3.3
* Properly reload multi-page files if they change on disk while being viewed
* Properly handle if a user closes pqiv while the image loader is still active

Expand Down
4 changes: 3 additions & 1 deletion pqiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,9 @@ void parse_configuration_file(int *argc, char **argv[]) {/*{{{*/
gchar *option_value = g_key_file_get_string(key_file, "options", iter->long_name, NULL);
if(option_value != NULL) {
if(iter->arg == G_OPTION_ARG_CALLBACK) {
(*(GOptionArgFunc *)(iter->arg_data))(NULL, option_value, NULL, &error_pointer);
gchar long_name[64];
g_snprintf(long_name, 64, "--%s", iter->long_name);
((GOptionArgFunc)(iter->arg_data))(long_name, option_value, NULL, &error_pointer);
}
else {
*(gchar **)(iter->arg_data) = option_value;
Expand Down
2 changes: 1 addition & 1 deletion pqiv.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "lib/bostree.h"

#ifndef PQIV_VERSION
#define PQIV_VERSION "2.3.4"
#define PQIV_VERSION "2.3.5"
#endif

#define FILE_FLAGS_ANIMATION (guint)(1)
Expand Down

0 comments on commit 236bda1

Please sign in to comment.