mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 20:00:23 +02:00
Added function expand_escapes() which handles now escaping /EVAL and input
line if /SET expand_escapes is set. Supported escapes are \t, \r, \n, \e (ESC), \x (HEX, \x1b), \c (CTRL char, \cA), \000 (octal, \033) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1727 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
b667af72aa
commit
98b82723a1
4 changed files with 68 additions and 20 deletions
|
|
@ -703,6 +703,7 @@ static char *expand_escapes(const char *line, SERVER_REC *server,
|
|||
WI_ITEM_REC *item)
|
||||
{
|
||||
char *ptr, *ret;
|
||||
int chr;
|
||||
|
||||
ret = ptr = g_malloc(strlen(line)+1);
|
||||
for (; *line != '\0'; line++) {
|
||||
|
|
@ -726,16 +727,14 @@ static char *expand_escapes(const char *line, SERVER_REC *server,
|
|||
signal_emit("send text", 3, ret, server, item);
|
||||
ptr = ret;
|
||||
break;
|
||||
case 't':
|
||||
*ptr++ = '\t';
|
||||
break;
|
||||
case '\\':
|
||||
*ptr++ = '\\';
|
||||
break;
|
||||
default:
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = *line;
|
||||
break;
|
||||
chr = expand_escape(&line);
|
||||
if (chr != -1)
|
||||
*ptr++ = chr;
|
||||
else {
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = *line;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue