From 4c09df3e7d47326494c76dd8b1a200274f5d1fe7 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 25 Jan 2011 18:23:36 +0100 Subject: options.c: Move hold-action check to check_options. In feh_parse_option_array, when a hold-action is set from a theme it would behave differently than one set from commandline. Theme: ;;foo would become foo (incorrect) cmdline: ;;foo would become ;foo (correct) I doubt anybody would ever have noticed it, since ;foo is a shell syntax error anyways, but it's definitely better to be on the safe side. --- src/options.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/options.c b/src/options.c index 78e768e..6427597 100644 --- a/src/options.c +++ b/src/options.c @@ -429,7 +429,6 @@ static void feh_parse_option_array(int argc, char **argv) {0, 0, 0, 0} }; int optch = 0, cmdx = 0; - int i = 0; /* Now to pass some optionarinos */ while ((optch = getopt_long(argc, argv, stropts, lopts, &cmdx)) != EOF) { @@ -791,13 +790,6 @@ static void feh_parse_option_array(int argc, char **argv) } } - for (i = 0; i < 10; i++) { - if (opt.actions[i] && !opt.hold_actions[i] && (opt.actions[i][0] == ';')) { - opt.hold_actions[i] = 1; - opt.actions[i] = &opt.actions[i][1]; - } - } - /* So that we can safely be called again */ optind = 1; return; @@ -805,6 +797,14 @@ static void feh_parse_option_array(int argc, char **argv) static void check_options(void) { + int i; + for (i = 0; i < 10; i++) { + if (opt.actions[i] && !opt.hold_actions[i] && (opt.actions[i][0] == ';')) { + opt.hold_actions[i] = 1; + opt.actions[i] = &opt.actions[i][1]; + } + } + if ((opt.index + opt.collage) > 1) { weprintf("you can't use collage mode and index mode together.\n" " I'm going with index"); -- cgit v1.2.3