? src/protocols/silc/silc.c.stu ? src/protocols/silc/silcgaim.diff Index: src/protocols/silc/silc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/silc/silc.c,v retrieving revision 1.24.2.8 diff -u -p -r1.24.2.8 silc.c --- src/protocols/silc/silc.c 5 May 2005 13:08:38 -0000 1.24.2.8 +++ src/protocols/silc/silc.c 9 May 2005 19:56:47 -0000 @@ -277,12 +277,14 @@ silcgaim_login(GaimAccount *account) /* Init SILC client */ if (!silc_client_init(client)) { + gc->wants_to_die = TRUE; gaim_connection_error(gc, ("Cannot initialize SILC protocol")); return; } /* Check the ~/.silc dir and create it, and new key pair if necessary. */ if (!silcgaim_check_silc_dir(gc)) { + gc->wants_to_die = TRUE; gaim_connection_error(gc, ("Cannot find/access ~/.silc directory")); return; } Index: src/protocols/silc/util.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/silc/util.c,v retrieving revision 1.8.2.4 diff -u -p -r1.8.2.4 util.c --- src/protocols/silc/util.c 15 Apr 2005 01:47:08 -0000 1.8.2.4 +++ src/protocols/silc/util.c 9 May 2005 19:56:47 -0000 @@ -72,6 +72,7 @@ gboolean silcgaim_check_silc_dir(GaimCon char filename[256], file_public_key[256], file_private_key[256]; char servfilename[256], clientfilename[256], friendsfilename[256]; char pkd[256], prd[256]; + const char *prvk, *pubk; struct stat st; struct passwd *pw; @@ -194,10 +195,14 @@ gboolean silcgaim_check_silc_dir(GaimCon */ g_snprintf(pkd, sizeof(pkd), "%s" G_DIR_SEPARATOR_S "public_key.pub", silcgaim_silcdir()); g_snprintf(prd, sizeof(prd), "%s" G_DIR_SEPARATOR_S "private_key.prv", silcgaim_silcdir()); - g_snprintf(file_public_key, sizeof(file_public_key) - 1, "%s", - gaim_account_get_string(gc->account, "public-key", pkd)); - g_snprintf(file_private_key, sizeof(file_public_key) - 1, "%s", - gaim_account_get_string(gc->account, "private-key", prd)); + pubk = gaim_account_get_string(gc->account, "private-key", prd); + if ((pubk != NULL) && (*pubk == '\0')) + pubk = NULL; + g_snprintf(file_public_key, sizeof(file_public_key) - 1, "%s", pubk != NULL ? pubk : pkd); + prvk = gaim_account_get_string(gc->account, "public-key", pkd); + if ((prvk != NULL) && (*prvk == '\0')) + prvk = NULL; + g_snprintf(file_private_key, sizeof(file_public_key) - 1, "%s", prvk != NULL ? prvk : prd); if ((g_stat(file_public_key, &st)) == -1) { /* If file doesn't exist */