while (tok != NULL) {
if(strncmp(tok,"features=", 9) == 0) {
+ char *t = tok+9;
+ char *u = strchr(t, ';');
+ if (u)
+ *u = '\0';
if(g_options->features != NULL) {
- dbprintf(("%s: multiple features option\n",
- debug_prefix(NULL)));
+ dbprintf(_("multiple features option\n"));
if(verbose) {
- printf("ERROR [multiple features option]\n");
+ g_printf(_("ERROR [multiple features option]\n"));
}
}
- if((g_options->features = am_string_to_feature(tok+9)) == NULL) {
- dbprintf(("%s: bad features value \"%s\n",
- debug_prefix(NULL), tok+10));
+ if((g_options->features = am_string_to_feature(t)) == NULL) {
+ dbprintf(_("bad features value \"%s\"\n"), t);
if(verbose) {
- printf("ERROR [bad features value \"%s\"]\n", tok+10);
+ g_printf(_("ERROR [bad features value \"%s\"]\n"), t);
}
}
+ if (u)
+ *u = ';';
}
else if(strncmp(tok,"hostname=", 9) == 0) {
if(g_options->hostname != NULL) {
- dbprintf(("%s: multiple hostname option\n",
- debug_prefix(NULL)));
+ dbprintf(_("multiple hostname option\n"));
if(verbose) {
- printf("ERROR [multiple hostname option]\n");
+ g_printf(_("ERROR [multiple hostname option]\n"));
}
}
g_options->hostname = stralloc(tok+9);
}
else if(strncmp(tok,"auth=", 5) == 0) {
if(g_options->auth != NULL) {
- dbprintf(("%s: multiple auth option\n",
- debug_prefix(NULL)));
+ dbprintf(_("multiple auth option\n"));
if(verbose) {
- printf("ERROR [multiple auth option]\n");
+ g_printf(_("ERROR [multiple auth option]\n"));
}
}
g_options->auth = stralloc(tok+5);
}
else if(strncmp(tok,"maxdumps=", 9) == 0) {
if(g_options->maxdumps != 0) {
- dbprintf(("%s: multiple maxdumps option\n",
- debug_prefix(NULL)));
+ dbprintf(_("multiple maxdumps option\n"));
if(verbose) {
- printf("ERROR [multiple maxdumps option]\n");
+ g_printf(_("ERROR [multiple maxdumps option]\n"));
}
}
if(sscanf(tok+9, "%d;", &new_maxdumps) == 1) {
g_options->maxdumps = new_maxdumps;
}
else {
- dbprintf(("%s: bad maxdumps value \"%s\"\n",
- debug_prefix(NULL), tok+9));
+ dbprintf(_("bad maxdumps value \"%s\"\n"), tok+9);
if(verbose) {
- printf("ERROR [bad maxdumps value \"%s\"]\n",
+ g_printf(_("ERROR [bad maxdumps value \"%s\"]\n"),
tok+9);
}
}
}
else {
- dbprintf(("%s: bad maxdumps value \"%s\"\n",
- debug_prefix(NULL), tok+9));
+ dbprintf(_("bad maxdumps value \"%s\"\n"), tok+9);
if(verbose) {
- printf("ERROR [bad maxdumps value \"%s\"]\n",
+ g_printf(_("ERROR [bad maxdumps value \"%s\"]\n"),
tok+9);
}
}
}
else if(strncmp(tok,"config=", 7) == 0) {
if(g_options->config != NULL) {
- dbprintf(("%s: multiple config option\n",
- debug_prefix(NULL)));
+ dbprintf(_("multiple config option\n"));
if(verbose) {
- printf("ERROR [multiple config option]\n");
+ g_printf(_("ERROR [multiple config option]\n"));
}
}
g_options->config = stralloc(tok+7);
if (strchr(g_options->config, '/')) {
amfree(g_options->config);
- dbprintf(("%s: invalid character in config option\n",
- debug_prefix(NULL)));
+ dbprintf(_("invalid character in config option\n"));
if(verbose) {
- printf("ERROR [invalid character in config option]\n");
+ g_printf(_("ERROR [invalid character in config option]\n"));
}
}
}
else {
- dbprintf(("%s: unknown option \"%s\"\n",
- debug_prefix(NULL), tok));
+ dbprintf(_("unknown option \"%s\"\n"), tok);
if(verbose) {
- printf("ERROR [unknown option \"%s\"]\n", tok);
+ g_printf(_("ERROR [unknown option \"%s\"]\n"), tok);
}
}
tok = strtok(NULL, ";");
free_g_options(
g_option_t * g_options)
{
- amfree(g_options->str);
- am_release_feature_set(g_options->features);
- amfree(g_options->hostname);
- amfree(g_options->auth);
- amfree(g_options->config);
- amfree(g_options);
+ if (g_options != NULL) {
+ amfree(g_options->str);
+ am_release_feature_set(g_options->features);
+ amfree(g_options->hostname);
+ amfree(g_options->auth);
+ amfree(g_options->config);
+ amfree(g_options);
+ }
}