From 4a05b4c3e653ccc69941129837d2ae60d83cbaa1 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 18 Oct 2010 03:11:51 +0000 Subject: [PATCH] (trunk cli) #3269 "transmission-cli 2.10 segfaults" -- r11330 wasn't the right fix. Thanks to Longinus00 for the proofreading. --- cli/cli.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cli/cli.c b/cli/cli.c index 70a7d8c48..cb4e7c468 100644 --- a/cli/cli.c +++ b/cli/cli.c @@ -232,14 +232,6 @@ main( int argc, char ** argv ) printf( "%s %s\n", MY_READABLE_NAME, LONG_VERSION_STRING ); - /* the command line overrides defaults */ - tr_bencInitDict( &settings, 0 ); - if( parseCommandLine( &settings, argc, (const char**)argv ) ) - return EXIT_FAILURE; - - if( showVersion ) - return 0; - /* user needs to pass in at least one argument */ if( argc < 2 ) { tr_getopt_usage( MY_READABLE_NAME, getUsage( ), options ); @@ -247,9 +239,17 @@ main( int argc, char ** argv ) } /* load the defaults from config file + libtransmission defaults */ + tr_bencInitDict( &settings, 0 ); configDir = getConfigDir( argc, (const char**)argv ); tr_sessionLoadSettings( &settings, configDir, MY_CONFIG_NAME ); + /* the command line overrides defaults */ + if( parseCommandLine( &settings, argc, (const char**)argv ) ) + return EXIT_FAILURE; + + if( showVersion ) + return 0; + /* Check the options for validity */ if( !torrentPath ) { fprintf( stderr, "No torrent specified!\n" ); -- 2.40.0