From: Pekka Riikonen Date: Sat, 7 Sep 2002 12:08:32 +0000 (+0000) Subject: Fixed -C option to work on command line. Bug #16. X-Git-Tag: silc.client.0.9.5~7 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=6d162cd97fa37e37ad32771aa1a7bf327f52928e Fixed -C option to work on command line. Bug #16. --- diff --git a/CHANGES b/CHANGES index 3c734fc7..fa532993 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Sat Sep 7 15:08:13 EEST 2002 Pekka Riikonen + + * Moved -C option parsing in Irssi SILC client at same time + as other options. The UI was initialized earlier and caused + problems on command line. Bug #16. Affected file is + irssi/src/silc/core/silc-core.c. + Mon Sep 2 23:00:30 CEST 2002 Johnny Mnemonic * Added global variable silc_log_timestamp that tells silclog diff --git a/apps/irssi/src/silc/core/silc-channels.c b/apps/irssi/src/silc/core/silc-channels.c index a9b8c953..f2ed9926 100644 --- a/apps/irssi/src/silc/core/silc-channels.c +++ b/apps/irssi/src/silc/core/silc-channels.c @@ -175,7 +175,7 @@ static void command_part(const char *data, SILC_SERVER_REC *server, chanrec->left = TRUE; silc_command_exec(server, "LEAVE", chanrec->name); signal_stop(); - + channel_destroy(CHANNEL(chanrec)); } diff --git a/apps/irssi/src/silc/core/silc-core.c b/apps/irssi/src/silc/core/silc-core.c index fedb2106..f34400e9 100644 --- a/apps/irssi/src/silc/core/silc-core.c +++ b/apps/irssi/src/silc/core/silc-core.c @@ -302,11 +302,8 @@ void silc_opt_callback(poptContext con, sleep(1); #endif } -} -static void sig_init_read_settings(void) -{ - if (opt_create_keypair) { + if (strcmp(opt->longName, "create-key-pair") == 0) { /* Create new key pair and exit */ silc_cipher_register_default(); silc_pkcs_register_default(); @@ -336,12 +333,7 @@ void silc_core_init(void) "List supported PKCSs", NULL }, { "debug", 'd', POPT_ARG_STRING, NULL, 0, "Enable debugging", "STRING" }, - { NULL, '\0', 0, NULL } - }; - - static struct poptOption options[] = { - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, silc_options, 0, NULL, NULL }, - { "create-key-pair", 'C', POPT_ARG_NONE, &opt_create_keypair, 0, + { "create-key-pair", 'C', POPT_ARG_NONE, NULL, 0, "Create new public key pair", NULL }, { "pkcs", 0, POPT_ARG_STRING, &opt_pkcs, 0, "Set the PKCS of the public key pair (-C)", "PKCS" }, @@ -354,8 +346,7 @@ void silc_core_init(void) SilcClientParams params; const char *def_cipher, *def_hash, *def_hmac; - args_register(options); - signal_add("irssi init read settings", (SIGNAL_FUNC) sig_init_read_settings); + args_register(silc_options); /* Settings */ settings_add_bool("server", "skip_motd", FALSE); @@ -464,8 +455,6 @@ void silc_core_deinit(void) if (idletag != -1) { signal_emit("chat protocol deinit", 1, chat_protocol_find("SILC")); - signal_remove("irssi init read settings", - (SIGNAL_FUNC) sig_init_read_settings); #ifdef SILC_DEBUG signal_remove("setup changed", (SIGNAL_FUNC) sig_debug_setup_changed); #endif