1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

--home, --config parameters now expand relative paths to absolute at startup.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1635 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-07-16 16:56:52 +00:00 committed by cras
parent 581fc794b4
commit 40c7fa1190

View File

@ -129,6 +129,7 @@ void core_init_paths(int argc, char *argv[])
{ "home", 0, POPT_ARG_STRING, NULL, 0, "Irssi home dir location (~/.irssi)", "PATH" },
{ NULL, '\0', 0, NULL }
};
char *str;
int n, len;
for (n = 1; n < argc; n++) {
@ -147,6 +148,20 @@ void core_init_paths(int argc, char *argv[])
}
}
if (irssi_dir != NULL && !g_path_is_absolute(irssi_dir)) {
str = irssi_dir;
irssi_dir = g_strdup_printf("%s/%s", g_get_current_dir(), str);
g_free(str);
}
if (irssi_config_file != NULL &&
!g_path_is_absolute(irssi_config_file)) {
str = irssi_config_file;
irssi_config_file =
g_strdup_printf("%s/%s", g_get_current_dir(), str);
g_free(str);
}
args_register(options);
if (irssi_dir == NULL)