1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 06:16:40 +02:00

Use empty real name by default in IRC config, instead of reading real name in /etc/passwd (bug #30111)

This commit is contained in:
Sebastien Helleu
2010-06-11 11:47:28 +02:00
parent 9def214c11
commit e7d1485c5a
3 changed files with 6 additions and 18 deletions
+3 -1
View File
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
FlashCode <flashcode@flashtux.org>
v0.3.3-dev, 2010-06-10
v0.3.3-dev, 2010-06-11
Version 0.3.3 (under dev!)
@@ -17,6 +17,8 @@ Version 0.3.3 (under dev!)
process)
* api: add function "string_expand_home", fix bug with replacement of home in
paths
* irc: use empty real name by default in config, instead of reading real name
in /etc/passwd (bug #30111)
* irc: add new options irc.look.display_host_join/join_local/quit and
irc.color.reason_quit
* irc: move options weechat.color.nicklist_prefix to irc plugin
+2 -15
View File
@@ -1356,12 +1356,12 @@ void
irc_config_server_create_default_options (struct t_config_section *section)
{
int i, length;
char *nicks, *username, *realname, *pos, *default_value;
char *nicks, *username, *realname, *default_value;
struct passwd *my_passwd;
nicks = NULL;
username = NULL;
realname = NULL;
realname = strdup ("");
/* Get the user's name from /etc/passwd */
if ((my_passwd = getpwuid (geteuid ())) != NULL)
@@ -1378,25 +1378,12 @@ irc_config_server_create_default_options (struct t_config_section *section)
my_passwd->pw_name);
}
username = strdup (my_passwd->pw_name);
if ((!my_passwd->pw_gecos)
|| (my_passwd->pw_gecos[0] == '\0')
|| (my_passwd->pw_gecos[0] == ',')
|| (my_passwd->pw_gecos[0] == ' '))
realname = strdup (my_passwd->pw_name);
else
{
realname = strdup (my_passwd->pw_gecos);
pos = strchr (realname, ',');
if (pos)
pos[0] = '\0';
}
}
else
{
/* default values if /etc/passwd can't be read */
nicks = strdup (IRC_SERVER_DEFAULT_NICKS);
username = strdup ("weechat");
realname = strdup ("weechat");
}
for (i = 0; i < IRC_SERVER_NUM_OPTIONS; i++)
+1 -2
View File
@@ -2195,8 +2195,7 @@ irc_server_login (struct t_irc_server *server)
(username && username[0]) ? username : "weechat",
(username && username[0]) ? username : "weechat",
server->addresses_array[server->index_current_address],
(realname && realname[0]) ?
realname : "weechat");
(realname && realname[0]) ? realname : ((username && username[0]) ? username : "weechat"));
if (server->hook_timer_connection)
weechat_unhook (server->hook_timer_connection);