Mercurial > hg > forks > geeqie
changeset 1972:09757f887309
Fix segfault when a filename is specified on the commandline
Somehow, the file-specified-on-commandline codepath developed a
dependency on the options global, which hadn't been initialized
yet. This change simply moves the commandline parsing to below
the options variable initialization.
(gdb) r /PATH/TO/FILE.jpg
[...]
(gdb) bt
#0 0x00000000004559d2 in filelist_read_real (dir_path=<optimized out>,
files=0x7fffffffe638, dirs=0x0, follow_symlinks=<optimized out>)
at filedata.c:955
#1 0x0000000000455f0c in file_data_new_group (
path_utf8=0x773300 "/PATH/TO/FILE.jpg") at filedata.c:1040
#2 0x000000000047472f in parse_command_line_add_file (
file_path=<optimized out>, path=0x773da8, file=0x773db0,
list=0x7fffffffe758, collection_list=0x773dc0) at main.c:128
#3 0x0000000000419ae2 in parse_command_line_process_file (
first_dir=0x7fffffffe768, collection_list=<optimized out>,
list=0x7fffffffe758, file=<optimized out>, path=<optimized out>,
file_path=0x773220 "/PATH/TO/FILE.jpg") at main.c:205
#4 parse_command_line (argv=0x7fffffffe888, argc=<optimized out>)
at main.c:241
#5 main (argc=2, argv=0x7fffffffe888) at main.c:805
author | Omari Stephens <xsdg@xsdg.org> |
---|---|
date | Mon, 27 Feb 2012 06:02:02 +0000 |
parents | 491b4e901f05 |
children | 738a8393257e |
files | src/main.c |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main.c Mon May 14 13:08:18 2012 +0200 +++ b/src/main.c Mon Feb 27 06:02:02 2012 +0000 @@ -801,9 +801,6 @@ DEBUG_1("%s main: pixbuf_inline_register_stock_icons", get_exec_time()); pixbuf_inline_register_stock_icons(); - DEBUG_1("%s main: parse_command_line", get_exec_time()); - parse_command_line(argc, argv); - DEBUG_1("%s main: mkdir_if_not_exists", get_exec_time()); /* these functions don't depend on config file */ mkdir_if_not_exists(get_rc_dir()); @@ -821,6 +818,9 @@ options = init_options(NULL); setup_default_options(options); + DEBUG_1("%s main: parse_command_line", get_exec_time()); + parse_command_line(argc, argv); + DEBUG_1("%s main: load_options", get_exec_time()); if (!load_options(options)) {