mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
*** empty log message ***
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2553 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
418678bc95
commit
ca234bdf5e
7 changed files with 47 additions and 7 deletions
|
|
@ -549,6 +549,31 @@ char *format_add_linestart(const char *text, const char *linestart)
|
|||
return ret;
|
||||
}
|
||||
|
||||
char *format_add_lineend(const char *text, const char *linestart)
|
||||
{
|
||||
GString *str;
|
||||
char *ret;
|
||||
|
||||
if (linestart == NULL)
|
||||
return g_strdup(text);
|
||||
|
||||
if (strchr(text, '\n') == NULL)
|
||||
return g_strconcat(text, linestart, NULL);
|
||||
|
||||
str = g_string_new(NULL);
|
||||
while (*text != '\0') {
|
||||
if (*text == '\n')
|
||||
g_string_append(str, linestart);
|
||||
g_string_append_c(str, *text);
|
||||
text++;
|
||||
}
|
||||
g_string_append(str, linestart);
|
||||
|
||||
ret = str->str;
|
||||
g_string_free(str, FALSE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define LINE_START_IRSSI_LEVEL \
|
||||
(MSGLEVEL_CLIENTERROR | MSGLEVEL_CLIENTNOTICE)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue