From 40c7fa1190c8c861188f6ecda692da280e4fdc25 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 16 Jul 2001 16:56:52 +0000 Subject: [PATCH] --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 --- src/core/core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/core/core.c b/src/core/core.c index f0a691f6..c4600993 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -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)