mirror of
https://github.com/irssi/irssi.git
synced 2026-08-16 23:22:16 +02:00
'\' characters in nicks were skipped when sending messages in queries.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2867 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
c9f5eafb3d
commit
d11cb0f2c2
3 changed files with 23 additions and 2 deletions
|
|
@ -770,3 +770,19 @@ int expand_escape(const char **data)
|
|||
return strtol(digit, NULL, 8);
|
||||
}
|
||||
}
|
||||
|
||||
/* Escape all '"', "'" and '\' chars with '\' */
|
||||
char *escape_string(const char *str)
|
||||
{
|
||||
char *ret, *p;
|
||||
|
||||
p = ret = g_malloc(strlen(str)*2+1);
|
||||
while (*str != '\0') {
|
||||
if (*str == '"' || *str == '\'' || *str == '\\')
|
||||
*p++ = '\\';
|
||||
*p++ = *str++;
|
||||
}
|
||||
*p = '\0';
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue