mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
/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:
parent
b8e1bb0444
commit
919abb2c6f
3 changed files with 70 additions and 3 deletions
|
|
@ -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': {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue