aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-08-24 19:01:05 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2008-08-24 19:01:05 +0100
commit7125cb3775a0e384c0f2fc08fd56df9582199502 (patch)
tree7972791c53152194e4c5053801abd071c17128ca /root_commands.c
parent934dddf3614eae2b4f305f42583b070bdbd5bc86 (diff)
Added SET_INVALID, which set evaluators should now return instead of NULL
when the given value is not accepted. This to allow certain variables actually be set to NULL (server, for example). This should fully close #444.
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/root_commands.c b/root_commands.c
index f55c4b5e..56a405a3 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -609,6 +609,8 @@ static void cmd_rename( irc_t *irc, char **cmd )
g_free( irc->mynick );
irc->mynick = g_strdup( cmd[2] );
+ /* If we're called internally (user did "set root_nick"),
+ let's not go O(INF). :-) */
if( strcmp( cmd[0], "set_rename" ) != 0 )
set_setstr( &irc->set, "root_nick", cmd[2] );
}
@@ -632,7 +634,7 @@ char *set_eval_root_nick( set_t *set, char *new_nick )
cmd_rename( irc, cmd );
}
- return strcmp( irc->mynick, new_nick ) == 0 ? new_nick : NULL;
+ return strcmp( irc->mynick, new_nick ) == 0 ? new_nick : SET_INVALID;
}
static void cmd_remove( irc_t *irc, char **cmd )