void core_init_paths(int argc, char *argv[])
{
static struct poptOption options[] = {
- { "config", 0, POPT_ARG_STRING, NULL, 0, "Configuration file location (~/.irssi/config)", "PATH" },
- { "home", 0, POPT_ARG_STRING, NULL, 0, "Irssi home dir location (~/.irssi)", "PATH" },
+ { "config", 0, POPT_ARG_STRING, NULL, 0, "Configuration file location (~/.silc/config)", "PATH" },
+ { "home", 0, POPT_ARG_STRING, NULL, 0, "Irssi home dir location (~/.silc)", "PATH" },
{ NULL, '\0', 0, NULL }
};
+ const char *home;
char *str;
int n, len;
args_register(options);
- if (irssi_dir == NULL)
- irssi_dir = g_strdup_printf(IRSSI_DIR_FULL, g_get_home_dir());
+ if (irssi_dir == NULL) {
+ home = g_get_home_dir();
+ if (home == NULL)
+ home = ".";
+
+ irssi_dir = g_strdup_printf(IRSSI_DIR_FULL, home);
+ }
if (irssi_config_file == NULL)
irssi_config_file = g_strdup_printf("%s/"IRSSI_HOME_CONFIG, irssi_dir);