summaryrefslogtreecommitdiff
path: root/src/fe-common/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-08-08 20:00:25 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-08-08 20:00:25 +0000
commit98b82723a126ca0c40982585c3754aa00bbed51f (patch)
tree1357ef3a32914fbbda442a358fca4d59a24ce424 /src/fe-common/core
parentb667af72aa9df7b7a8b658cb0742b0c34cd6a3c2 (diff)
downloadirssi-98b82723a126ca0c40982585c3754aa00bbed51f.zip
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
Diffstat (limited to 'src/fe-common/core')
-rw-r--r--src/fe-common/core/chat-completion.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/fe-common/core/chat-completion.c b/src/fe-common/core/chat-completion.c
index d1b90694..f580c7c0 100644
--- a/src/fe-common/core/chat-completion.c
+++ b/src/fe-common/core/chat-completion.c
@@ -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;
+ }
}
}