mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
deprecated glib strup/down fixes from exg.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5138 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
df1d7a7814
commit
8728207191
@ -325,7 +325,7 @@ void command_runsub(const char *cmd, const char *data,
|
||||
|
||||
subcmd = g_strconcat("command ", newcmd, NULL);
|
||||
|
||||
g_strdown(subcmd);
|
||||
ascii_strdown(subcmd);
|
||||
if (!signal_emit(subcmd, 3, args, server, item)) {
|
||||
defcmd = g_strdup_printf("default command %s", cmd);
|
||||
if (!signal_emit(defcmd, 3, data, server, item)) {
|
||||
@ -891,7 +891,7 @@ static void parse_command(const char *command, int expand_aliases,
|
||||
}
|
||||
|
||||
cmd = g_strconcat("command ", newcmd, NULL);
|
||||
g_strdown(cmd);
|
||||
ascii_strdown(cmd);
|
||||
|
||||
oldcmd = current_command;
|
||||
current_command = cmd+8;
|
||||
|
@ -943,3 +943,21 @@ int parse_size(const char *size, int *bytes)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char *ascii_strup(char *str)
|
||||
{
|
||||
char *s;
|
||||
|
||||
for (s = str; *s; s++)
|
||||
*s = g_ascii_toupper (*s);
|
||||
return str;
|
||||
}
|
||||
|
||||
char *ascii_strdown(char *str)
|
||||
{
|
||||
char *s;
|
||||
|
||||
for (s = str; *s; s++)
|
||||
*s = g_ascii_tolower (*s);
|
||||
return str;
|
||||
}
|
||||
|
@ -92,6 +92,9 @@ char *stristr(const char *data, const char *key);
|
||||
char *strstr_full(const char *data, const char *key);
|
||||
char *stristr_full(const char *data, const char *key);
|
||||
|
||||
char *ascii_strup(char *str);
|
||||
char *ascii_strdown(char *str);
|
||||
|
||||
/* Escape all '"', "'" and '\' chars with '\' */
|
||||
char *escape_string(const char *str);
|
||||
|
||||
|
@ -533,7 +533,7 @@ static char *line_get_command(const char *line, char **args, int aliases)
|
||||
} while (ptr != NULL);
|
||||
|
||||
if (cmd != NULL)
|
||||
g_strdown(cmd);
|
||||
ascii_strdown(cmd);
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ static void cmd_ctcp(const char *data, SERVER_REC *server)
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
|
||||
IRCTXT_DCC_CHAT_NOT_FOUND, target+1);
|
||||
} else {
|
||||
g_strup(ctcpcmd);
|
||||
ascii_strup(ctcpcmd);
|
||||
signal_emit("message dcc own_ctcp", 3, dcc, ctcpcmd, ctcpdata);
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ static void cmd_ctcp(const char *data, IRC_SERVER_REC *server,
|
||||
return;
|
||||
}
|
||||
|
||||
g_strup(ctcpcmd);
|
||||
ascii_strup(ctcpcmd);
|
||||
signal_emit("message irc own_ctcp", 4,
|
||||
server, ctcpcmd, ctcpdata, target);
|
||||
|
||||
|
@ -550,7 +550,7 @@ static void cmd_statusbar(const char *data)
|
||||
|
||||
/* call the subcommand */
|
||||
signal = g_strconcat("command statusbar ", cmd, NULL);
|
||||
g_strdown(signal);
|
||||
ascii_strdown(signal);
|
||||
if (!signal_emit(signal, 4, params, NULL, NULL, node)) {
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
|
||||
TXT_STATUSBAR_UNKNOWN_COMMAND, cmd);
|
||||
|
@ -238,7 +238,7 @@ static void ctcp_msg(IRC_SERVER_REC *server, const char *data,
|
||||
args = strchr(str+9, ' ');
|
||||
if (args != NULL) *args++ = '\0'; else args = "";
|
||||
|
||||
g_strdown(str+9);
|
||||
ascii_strdown(str+9);
|
||||
if (!signal_emit(str, 5, server, args, nick, addr, target)) {
|
||||
signal_emit("default ctcp msg", 5,
|
||||
server, data, nick, addr, target);
|
||||
@ -258,7 +258,7 @@ static void ctcp_reply(IRC_SERVER_REC *server, const char *data,
|
||||
args = strchr(str+11, ' ');
|
||||
if (args != NULL) *args++ = '\0'; else args = "";
|
||||
|
||||
g_strdown(str+11);
|
||||
ascii_strdown(str+11);
|
||||
if (!signal_emit(str, 5, server, args, nick, addr, target)) {
|
||||
signal_emit("default ctcp reply", 5,
|
||||
server, data, nick, addr, target);
|
||||
|
@ -104,7 +104,7 @@ static void cmd_ctcp(const char *data, IRC_SERVER_REC *server,
|
||||
if (*target == '\0' || *ctcpcmd == '\0')
|
||||
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||
|
||||
g_strup(ctcpcmd);
|
||||
ascii_strup(ctcpcmd);
|
||||
if (*ctcpdata == '\0')
|
||||
g_string_printf(tmpstr, "PRIVMSG %s :\001%s\001", target, ctcpcmd);
|
||||
else {
|
||||
@ -138,7 +138,7 @@ static void cmd_nctcp(const char *data, IRC_SERVER_REC *server,
|
||||
if (*target == '\0' || *ctcpcmd == '\0')
|
||||
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||
|
||||
g_strup(ctcpcmd);
|
||||
ascii_strup(ctcpcmd);
|
||||
recoded = recode_out(SERVER(server), ctcpdata, target);
|
||||
g_string_printf(tmpstr, "NOTICE %s :\001%s %s\001", target, ctcpcmd, recoded);
|
||||
g_free(recoded);
|
||||
|
@ -290,7 +290,7 @@ static void irc_server_event(IRC_SERVER_REC *server, const char *line,
|
||||
args = strchr(event+6, ' ');
|
||||
if (args != NULL) *args++ = '\0'; else args = "";
|
||||
while (*args == ' ') args++;
|
||||
g_strdown(event);
|
||||
ascii_strdown(event);
|
||||
|
||||
/* check if event needs to be redirected */
|
||||
signal = server_redirect_get_signal(server, nick, event, args);
|
||||
|
@ -281,7 +281,7 @@ static void cmd_ctcp(const char *data, IRC_SERVER_REC *server)
|
||||
|
||||
dcc = dcc_chat_find_id(target+1);
|
||||
if (dcc != NULL) {
|
||||
g_strup(ctcpcmd);
|
||||
ascii_strup(ctcpcmd);
|
||||
|
||||
str = g_strconcat(ctcpcmd, " ", ctcpdata, NULL);
|
||||
dcc_ctcp_message(server, dcc->nick, dcc, FALSE, str);
|
||||
@ -719,7 +719,7 @@ static void dcc_chat_msg(CHAT_DCC_REC *dcc, const char *msg)
|
||||
|
||||
cmd = g_ascii_strup(cmd, -1);
|
||||
|
||||
g_strdown(event+9);
|
||||
ascii_strdown(event+9);
|
||||
if (!signal_emit(event, 2, dcc, ptr)) {
|
||||
signal_emit(reply ? "default dcc reply" :
|
||||
"default dcc ctcp", 3, dcc, cmd, ptr);
|
||||
|
@ -367,7 +367,7 @@ static void ctcp_msg_dcc(IRC_SERVER_REC *server, const char *data,
|
||||
args = strchr(str+13, ' ');
|
||||
if (args != NULL) *args++ = '\0'; else args = "";
|
||||
|
||||
g_strdown(str+13);
|
||||
ascii_strdown(str+13);
|
||||
if (!signal_emit(str, 6, server, args, nick, addr, target, chat)) {
|
||||
signal_emit("default ctcp msg dcc", 6,
|
||||
server, data, nick, addr, target, chat);
|
||||
@ -389,7 +389,7 @@ static void ctcp_reply_dcc(IRC_SERVER_REC *server, const char *data,
|
||||
args = strchr(str+15, ' ');
|
||||
if (args != NULL) *args++ = '\0'; else args = "";
|
||||
|
||||
g_strdown(str+15);
|
||||
ascii_strdown(str+15);
|
||||
if (!signal_emit(str, 5, server, args, nick, addr, target)) {
|
||||
signal_emit("default ctcp reply dcc", 5,
|
||||
server, data, nick, addr, target);
|
||||
@ -502,7 +502,7 @@ static void cmd_dcc_close(char *data, IRC_SERVER_REC *server)
|
||||
|
||||
if (*nick == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||
|
||||
g_strup(typestr);
|
||||
ascii_strup(typestr);
|
||||
type = dcc_str2type(typestr);
|
||||
if (type == -1) {
|
||||
signal_emit("dcc error unknown type", 1, typestr);
|
||||
|
@ -317,7 +317,7 @@ static void sig_listen_client(CLIENT_REC *client)
|
||||
args = strchr(cmd, ' ');
|
||||
if (args != NULL) *args++ = '\0'; else args = "";
|
||||
if (*args == ':') args++;
|
||||
g_strup(cmd);
|
||||
ascii_strup(cmd);
|
||||
|
||||
handle_client_cmd(client, cmd, args, str);
|
||||
|
||||
@ -391,7 +391,7 @@ static void sig_server_event(IRC_SERVER_REC *server, const char *line,
|
||||
args = strchr(event+6, ' ');
|
||||
if (args != NULL) *args++ = '\0'; else args = "";
|
||||
while (*args == ' ') args++;
|
||||
g_strdown(event);
|
||||
ascii_strdown(event);
|
||||
|
||||
signal = server_redirect_peek_signal(server, nick, event, args, &redirected);
|
||||
if ((signal != NULL && strncmp(signal, "proxy ", 6) != 0) ||
|
||||
|
Loading…
Reference in New Issue
Block a user