summaryrefslogtreecommitdiff
path: root/src/common/weeconfig.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2004-01-18 23:53:34 +0000
committerSebastien Helleu <flashcode@flashtux.org>2004-01-18 23:53:34 +0000
commit38bf163c173395571ca2772eda23bf162713a912 (patch)
tree0cf263e2f4e03380d02f25e9a0f5508f69ca035a /src/common/weeconfig.c
parent09a36a5d8ee6025822acfe6c9ac6d578f98323e4 (diff)
downloadweechat-38bf163c173395571ca2772eda23bf162713a912.zip
Servers allowed on command line (irc://nick:passwd@irc.example.org:port)
Diffstat (limited to 'src/common/weeconfig.c')
-rw-r--r--src/common/weeconfig.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/src/common/weeconfig.c b/src/common/weeconfig.c
index 98211aa05..4d91862b6 100644
--- a/src/common/weeconfig.c
+++ b/src/common/weeconfig.c
@@ -658,7 +658,7 @@ config_allocate_server (char *filename, int line_number)
return 0;
}
if (!server_new (cfg_server.name,
- cfg_server.autoconnect, cfg_server.address, cfg_server.port,
+ cfg_server.autoconnect, 0, cfg_server.address, cfg_server.port,
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
cfg_server.nick3, cfg_server.username, cfg_server.realname,
cfg_server.command, cfg_server.autojoin))
@@ -1194,23 +1194,26 @@ config_write (char *config_name)
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
- fprintf (file, "\n[server]\n");
- fprintf (file, "server_name=%s\n", ptr_server->name);
- fprintf (file, "server_autoconnect=%s\n",
- (ptr_server->autoconnect) ? "on" : "off");
- fprintf (file, "server_address=%s\n", ptr_server->address);
- fprintf (file, "server_port=%d\n", ptr_server->port);
- fprintf (file, "server_password=%s\n",
- (ptr_server->password) ? ptr_server->password : "");
- fprintf (file, "server_nick1=%s\n", ptr_server->nick1);
- fprintf (file, "server_nick2=%s\n", ptr_server->nick2);
- fprintf (file, "server_nick3=%s\n", ptr_server->nick3);
- fprintf (file, "server_username=%s\n", ptr_server->username);
- fprintf (file, "server_realname=%s\n", ptr_server->realname);
- fprintf (file, "server_command=%s\n",
- (ptr_server->command) ? ptr_server->command : "");
- fprintf (file, "server_autojoin=%s\n",
- (ptr_server->autojoin) ? ptr_server->autojoin : "");
+ if (!ptr_server->command_line)
+ {
+ fprintf (file, "\n[server]\n");
+ fprintf (file, "server_name=%s\n", ptr_server->name);
+ fprintf (file, "server_autoconnect=%s\n",
+ (ptr_server->autoconnect) ? "on" : "off");
+ fprintf (file, "server_address=%s\n", ptr_server->address);
+ fprintf (file, "server_port=%d\n", ptr_server->port);
+ fprintf (file, "server_password=%s\n",
+ (ptr_server->password) ? ptr_server->password : "");
+ fprintf (file, "server_nick1=%s\n", ptr_server->nick1);
+ fprintf (file, "server_nick2=%s\n", ptr_server->nick2);
+ fprintf (file, "server_nick3=%s\n", ptr_server->nick3);
+ fprintf (file, "server_username=%s\n", ptr_server->username);
+ fprintf (file, "server_realname=%s\n", ptr_server->realname);
+ fprintf (file, "server_command=%s\n",
+ (ptr_server->command) ? ptr_server->command : "");
+ fprintf (file, "server_autojoin=%s\n",
+ (ptr_server->autojoin) ? ptr_server->autojoin : "");
+ }
}
fclose (file);