summaryrefslogtreecommitdiff
path: root/src/core/core.c
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2008-02-03 16:48:02 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2008-02-03 16:48:02 +0000
commitab8da71d29ad30030e39fd00aa2dc09666446b61 (patch)
treed9742fb78f66f5484712ea499c1c35df15d35c9c /src/core/core.c
parentc403b70de4b6b03d7d823d808f6e57f55cb07155 (diff)
downloadirssi-ab8da71d29ad30030e39fd00aa2dc09666446b61.zip
Remove popt and use glib GOption commandline option parser
(glib-2.6 is now the minimum required version). git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4700 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/core.c')
-rw-r--r--src/core/core.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/core.c b/src/core/core.c
index 5b3164a5..647eb6b4 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -167,10 +167,10 @@ static char *fix_path(const char *str)
void core_register_options(void)
{
- static struct poptOption options[] = {
- { "config", 0, POPT_ARG_STRING, &irssi_config_file, 0, "Configuration file location (~/.irssi/config)", "PATH" },
- { "home", 0, POPT_ARG_STRING, &irssi_dir, 0, "Irssi home dir location (~/.irssi)", "PATH" },
- { NULL, '\0', 0, NULL }
+ static GOptionEntry options[] = {
+ { "config", 0, 0, G_OPTION_ARG_STRING, &irssi_config_file, "Configuration file location (~/.irssi/config)", "PATH" },
+ { "home", 0, 0, G_OPTION_ARG_STRING, &irssi_dir, "Irssi home dir location (~/.irssi)", "PATH" },
+ { NULL }
};
args_register(options);
@@ -192,6 +192,7 @@ void core_preinit(const char *path)
} else {
str = irssi_dir;
irssi_dir = fix_path(str);
+ g_free(str);
len = strlen(irssi_dir);
if (irssi_dir[len-1] == G_DIR_SEPARATOR)
irssi_dir[len-1] = '\0';
@@ -201,6 +202,7 @@ void core_preinit(const char *path)
else {
str = irssi_config_file;
irssi_config_file = fix_path(str);
+ g_free(str);
}
session_set_binary(path);