mirror of
https://github.com/transmission/transmission
synced 2025-03-02 17:55:22 +00:00
(trunk libT) fix getConfigDir() bug reported by wereHamster
This commit is contained in:
parent
b545dbe28a
commit
2eb9888db4
2 changed files with 11 additions and 6 deletions
10
cli/cli.c
10
cli/cli.c
|
@ -48,7 +48,6 @@ static sig_atomic_t manualUpdate = 0;
|
|||
static const char * torrentPath = NULL;
|
||||
static const char * finishCall = NULL;
|
||||
static const char * announce = NULL;
|
||||
static const char * configdir = NULL;
|
||||
static const char * sourceFile = NULL;
|
||||
static const char * comment = NULL;
|
||||
|
||||
|
@ -272,9 +271,12 @@ getConfigDir( int argc, const char ** argv )
|
|||
const char * optarg;
|
||||
const int ind = tr_optind;
|
||||
|
||||
while(( c = tr_getopt( getUsage( ), argc, argv, options, &optarg )))
|
||||
if( c == 'g' )
|
||||
configdir = optarg;
|
||||
while(( c = tr_getopt( getUsage( ), argc, argv, options, &optarg ))) {
|
||||
if( c == 'g' ) {
|
||||
configDir = optarg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tr_optind = ind;
|
||||
|
||||
|
|
|
@ -156,9 +156,12 @@ getConfigDir( int argc, const char ** argv )
|
|||
const char * optarg;
|
||||
const int ind = tr_optind;
|
||||
|
||||
while(( c = tr_getopt( getUsage( ), argc, argv, options, &optarg )))
|
||||
if( c == 'g' )
|
||||
while(( c = tr_getopt( getUsage( ), argc, argv, options, &optarg ))) {
|
||||
if( c == 'g' ) {
|
||||
configDir = optarg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tr_optind = ind;
|
||||
|
||||
|
|
Loading…
Reference in a new issue