diff options
Diffstat (limited to 'src/arm/gnunet-service-arm.c')
-rw-r--r-- | src/arm/gnunet-service-arm.c | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 152a358fc..5014faa15 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -450,26 +450,50 @@ start_process (struct ServiceList *sl, | |||
450 | if (GNUNET_OK != | 450 | if (GNUNET_OK != |
451 | GNUNET_CONFIGURATION_get_value_string (cfg, sl->name, "OPTIONS", | 451 | GNUNET_CONFIGURATION_get_value_string (cfg, sl->name, "OPTIONS", |
452 | &options)) | 452 | &options)) |
453 | options = NULL; | ||
454 | else | ||
455 | options = GNUNET_CONFIGURATION_expand_dollar (cfg, options); | ||
456 | { | ||
457 | char *new_options; | ||
458 | char *optpos; | ||
459 | char *fin_options; | ||
460 | |||
461 | fin_options = GNUNET_strdup (final_option); | ||
462 | /* replace '{}' with service name */ | ||
463 | while (NULL != (optpos = strstr (fin_options, "{}"))) | ||
464 | { | ||
465 | /* terminate string at opening parenthesis */ | ||
466 | *optpos = 0; | ||
467 | GNUNET_asprintf (&new_options, | ||
468 | "%s%s%s", | ||
469 | fin_options, | ||
470 | sl->name, | ||
471 | optpos + 2); | ||
472 | GNUNET_free (fin_options); | ||
473 | fin_options = new_options; | ||
474 | } | ||
475 | if (NULL != options) | ||
453 | { | 476 | { |
454 | char *new_options; | 477 | /* combine "fin_options" with "options" */ |
455 | char *optpos; | 478 | optpos = options; |
456 | options = GNUNET_strdup (final_option); | 479 | GNUNET_asprintf (&options, |
457 | /* replace '{}' with service name */ | 480 | "%s %s", |
458 | while (NULL != (optpos = strstr (options, "{}"))) | 481 | optpos, |
459 | { | 482 | fin_options); |
460 | /* terminate string at opening parenthesis */ | 483 | GNUNET_free (optpos); |
461 | *optpos = 0; | ||
462 | GNUNET_asprintf (&new_options, "%s%s%s", options, sl->name, optpos + 2); | ||
463 | GNUNET_free (options); | ||
464 | options = new_options; | ||
465 | } | ||
466 | options = GNUNET_CONFIGURATION_expand_dollar (cfg, options); | ||
467 | } | 484 | } |
485 | else | ||
486 | { | ||
487 | /* only have "fin_options", use that */ | ||
488 | options = fin_options; | ||
489 | } | ||
490 | } | ||
468 | use_debug = GNUNET_CONFIGURATION_get_value_yesno (cfg, sl->name, "DEBUG"); | 491 | use_debug = GNUNET_CONFIGURATION_get_value_yesno (cfg, sl->name, "DEBUG"); |
469 | 492 | ||
470 | { | 493 | { |
471 | const char *service_type = NULL; | 494 | const char *service_type = NULL; |
472 | const char *choices[] = { "GNUNET", "SIMPLE", NULL }; | 495 | const char *choices[] = { "GNUNET", "SIMPLE", NULL }; |
496 | |||
473 | is_simple_service = GNUNET_NO; | 497 | is_simple_service = GNUNET_NO; |
474 | if ( (GNUNET_OK == | 498 | if ( (GNUNET_OK == |
475 | GNUNET_CONFIGURATION_get_value_choice (cfg, | 499 | GNUNET_CONFIGURATION_get_value_choice (cfg, |