mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05:00
Factor strchr call.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4802 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
b2c8ba134b
commit
0b9a3f4aef
@ -343,6 +343,7 @@ static char *expando_cmdchar(SERVER_REC *server, void *item, int *free_ret)
|
||||
static char *expando_chanmode(SERVER_REC *server, void *item, int *free_ret)
|
||||
{
|
||||
char *cmode;
|
||||
char *args;
|
||||
|
||||
*free_ret = FALSE;
|
||||
|
||||
@ -354,8 +355,9 @@ static char *expando_chanmode(SERVER_REC *server, void *item, int *free_ret)
|
||||
|
||||
*free_ret = TRUE;
|
||||
cmode = g_strdup(CHANNEL(item)->mode);
|
||||
if (strchr(cmode, ' ') != NULL)
|
||||
*(strchr(cmode, ' ')) = 0;
|
||||
args = strchr(cmode, ' ');
|
||||
if (args != NULL)
|
||||
*args = 0;
|
||||
|
||||
return cmode;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user