mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
Merge pull request #962 from horgh/horgh/comments-and-indentation
Fix some indentation and add some comments
This commit is contained in:
commit
8bbf9c696c
@ -1121,7 +1121,7 @@ int strip_real_length(const char *str, int len,
|
||||
*last_color_len = -1;
|
||||
|
||||
while (*str != '\0') {
|
||||
if (*str == 3) {
|
||||
if (*str == 3) { /* mIRC color */
|
||||
const char *mircstart = str;
|
||||
|
||||
if (last_color_pos != NULL)
|
||||
@ -1132,6 +1132,9 @@ int strip_real_length(const char *str, int len,
|
||||
*last_color_len = (int) (str-mircstart);
|
||||
|
||||
} else if (*str == 4 && str[1] != '\0') {
|
||||
/* We expect 4 to indicate an internal Irssi color code. However 4
|
||||
* also means hex color, an alternative to mIRC color codes. We
|
||||
* don't support those. */
|
||||
#ifdef TERM_TRUECOLOR
|
||||
if (str[1] == FORMAT_COLOR_24 && str[2] != '\0') {
|
||||
if (str[3] == '\0') str++;
|
||||
|
@ -388,9 +388,9 @@ static void sig_print_text(TEXT_DEST_REC *dest, const char *text,
|
||||
/* end of the line */
|
||||
pos = strip_real_length(text, hilight_end,
|
||||
&color_pos, &color_len);
|
||||
if (color_pos > 0)
|
||||
if (color_pos > 0) {
|
||||
g_string_append_len(tmp, text + color_pos, color_len);
|
||||
else {
|
||||
} else {
|
||||
/* no colors in line, change back to default */
|
||||
g_string_append_c(tmp, 4);
|
||||
g_string_append_c(tmp, FORMAT_STYLE_DEFAULTS);
|
||||
|
Loading…
Reference in New Issue
Block a user