*** empty log message ***

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2553 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-03-10 14:55:46 +00:00 committed by cras
commit ca234bdf5e
7 changed files with 47 additions and 7 deletions

View file

@ -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)