Merges from Irssi CVS.
[runtime.git] / apps / irssi / src / core / session.c
index 0248f13e07b6ed2dc8fc02bcfa03662042d27647..b541913489385e674326e0e3426a55fc8c966a46 100644 (file)
@@ -39,6 +39,7 @@ static char **session_args;
 
 void session_set_binary(const char *path)
 {
+       const char *envpath;
        char **paths, **tmp;
         char *str;
 
@@ -59,10 +60,10 @@ void session_set_binary(const char *path)
        }
 
        /* we'll need to find it from path. */
-       str = g_getenv("PATH");
-       if (str == NULL) return;
+       envpath = g_getenv("PATH");
+       if (envpath == NULL) return;
 
-       paths = g_strsplit(str, ":", -1);
+       paths = g_strsplit(envpath, ":", -1);
        for (tmp = paths; *tmp != NULL; tmp++) {
                 str = g_strconcat(*tmp, G_DIR_SEPARATOR_S, path, NULL);
                if (access(str, X_OK) == 0) {
@@ -146,6 +147,8 @@ static void session_save_channel(CHANNEL_REC *channel, CONFIG_REC *config,
 
        config_node_set_str(config, node, "name", channel->name);
        config_node_set_str(config, node, "topic", channel->topic);
+       config_node_set_str(config, node, "topic_by", channel->topic_by);
+       config_node_set_int(config, node, "topic_time", channel->topic_time);
        config_node_set_str(config, node, "key", channel->key);
 
        signal_emit("session save channel", 3, channel, config, node);
@@ -220,6 +223,8 @@ static void session_restore_channel(SERVER_REC *server, CONFIG_NODE *node)
 
        channel = CHAT_PROTOCOL(server)->channel_create(server, name, TRUE);
        channel->topic = g_strdup(config_node_get_str(node, "topic", NULL));
+       channel->topic_by = g_strdup(config_node_get_str(node, "topic_by", NULL));
+       channel->topic_time = config_node_get_int(node, "topic_time", 0);
         channel->key = g_strdup(config_node_get_str(node, "key", NULL));
         channel->session_rejoin = TRUE;