/EVAL will now expand \n and \t to newline and tab.

If you /SET expand_escapes ON and type \n or \t to text line, they
will be expanded.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@326 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-06-11 22:58:17 +00:00 committed by cras
commit 919abb2c6f
3 changed files with 70 additions and 3 deletions

View file

@ -506,6 +506,20 @@ static void print_string(TEXT_DEST_REC *dest, const char *text)
if (str != text) g_free(str);
}
/* append string to `out', expand newlines. */
static void printtext_append_str(TEXT_DEST_REC *dest, GString *out, const char *str)
{
while (*str != '\0') {
if (*str != '\n')
g_string_append_c(out, *str);
else {
print_string(dest, out->str);
g_string_truncate(out, 0);
}
str++;
}
}
static char *printtext_get_args(TEXT_DEST_REC *dest, const char *str, va_list va)
{
GString *out;
@ -525,7 +539,7 @@ static char *printtext_get_args(TEXT_DEST_REC *dest, const char *str, va_list va
switch (*str) {
case 's': {
char *s = (char *) va_arg(va, char *);
if (s && *s) g_string_append(out, s);
if (s && *s) printtext_append_str(dest, out, s);
break;
}
case 'd': {