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;
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;
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;