Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
separated short options in theme file #49
if a theme (but not normal commandline) contains multiple separate short options (e.g. -x -d instead of -xd), feh gives errors and ignores the first argument specified on commandline, or segfaults if no arguments are specified.
experienced with 1.14.1
I think I found the problem... and the fix is so simple:
diff --git a/src/options.c b/src/options.c index b5a95dd..052f8a8 100644 --- a/src/options.c +++ b/src/options.c @@ -794,7 +794,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) add_file_to_filelist_recursively(".", FILELIST_FIRST); /* So that we can safely be called again */ - optind = 1; + optind = 0; return; }
A small suggestion, "--debug" should be a special case, when loading theme options, there are some
Ooh. Yeah, that's looking good. Looks like I missed that while reading the documentation...
As for --debug: Right now it's useless for debugging getopt stuff, yeah. But I don't want yet another special case, I think I'll create a compile time switch for that (make debug=2 or similar). That way, you can really debug everything.