summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/rawlog.c11
-rw-r--r--src/fe-common/core/fe-messages.c4
-rw-r--r--src/fe-text/gui-printtext.c7
-rw-r--r--src/fe-text/term-terminfo.c34
-rw-r--r--src/irc/core/irc-commands.c9
5 files changed, 38 insertions, 27 deletions
diff --git a/src/core/rawlog.c b/src/core/rawlog.c
index e66f20dd..2fa6b850 100644
--- a/src/core/rawlog.c
+++ b/src/core/rawlog.c
@@ -102,14 +102,15 @@ void rawlog_redirect(RAWLOG_REC *rawlog, const char *str)
static void rawlog_dump(RAWLOG_REC *rawlog, int f)
{
GSList *tmp;
- ssize_t ret = 1;
+ ssize_t ret = 0;
- for (tmp = rawlog->lines; ret && tmp != NULL; tmp = tmp->next) {
+ for (tmp = rawlog->lines; ret != -1 && tmp != NULL; tmp = tmp->next) {
ret = write(f, tmp->data, strlen((char *) tmp->data));
- ret &= write(f, "\n", 1);
- }
+ if (ret != -1)
+ ret = write(f, "\n", 1);
+ }
- if (ret <= 0) {
+ if (ret == -1) {
g_warning("rawlog write() failed: %s", strerror(errno));
}
}
diff --git a/src/fe-common/core/fe-messages.c b/src/fe-common/core/fe-messages.c
index 56fe89f8..95d9a9d8 100644
--- a/src/fe-common/core/fe-messages.c
+++ b/src/fe-common/core/fe-messages.c
@@ -82,7 +82,9 @@ char *expand_emphasis(WI_ITEM_REC *item, const char *text)
continue;
if (!ishighalnum(end[-1]) || ishighalnum(end[1]) ||
end[1] == type || end[1] == '*' || end[1] == '_' ||
- (type == 29 && end[1] != '\0' && ishighalnum(end[2])))
+ /* special case for italics to not emphasise
+ common paths by skipping /.../.X */
+ (type == 29 && i_ispunct(end[1]) && ishighalnum(end[2])))
continue;
if (IS_CHANNEL(item)) {
diff --git a/src/fe-text/gui-printtext.c b/src/fe-text/gui-printtext.c
index cf6028b5..337d0739 100644
--- a/src/fe-text/gui-printtext.c
+++ b/src/fe-text/gui-printtext.c
@@ -158,8 +158,11 @@ static void get_colors(int flags, int *fg, int *bg, int *attr)
if (*bg >= 0) {
*bg = mirc_colors[*bg % 100];
flags &= ~GUI_PRINT_FLAG_COLOR_24_BG;
- if (settings_get_bool("mirc_blink_fix"))
- *bg = term_color256map[*bg&0xff] & ~0x08;
+ if (settings_get_bool("mirc_blink_fix")) {
+ if (*bg < 16) /* ansi bit flip :-( */
+ *bg = (*bg&8) | (*bg&4)>>2 | (*bg&2) | (*bg&1)<<2;
+ *bg = term_color256map[*bg&0xff] & 7;
+ }
}
if (*fg >= 0) {
*fg = mirc_colors[*fg % 100];
diff --git a/src/fe-text/term-terminfo.c b/src/fe-text/term-terminfo.c
index a0b257c4..b13426d1 100644
--- a/src/fe-text/term-terminfo.c
+++ b/src/fe-text/term-terminfo.c
@@ -324,6 +324,7 @@ static int termctl_set_color_24bit(int bg, unsigned int lc)
}
#define COLOR_RESET UINT_MAX
+#define COLOR_BLACK24 COLOR_RESET - 1
/* Change active color */
#ifdef TERM_TRUECOLOR
@@ -334,17 +335,26 @@ void term_set_color(TERM_WINDOW *window, int col)
{
int set_normal;
- unsigned int fg =
+ unsigned int fg, bg;
#ifdef TERM_TRUECOLOR
- (col & ATTR_FGCOLOR24) ? fgcol24 << 8 :
+ if (col & ATTR_FGCOLOR24) {
+ if (fgcol24)
+ fg = fgcol24 << 8;
+ else
+ fg = COLOR_BLACK24;
+ } else
#endif
- (col & FG_MASK);
+ fg = (col & FG_MASK);
- unsigned int bg =
#ifdef TERM_TRUECOLOR
- (col & ATTR_BGCOLOR24) ? bgcol24 << 8 :
+ if (col & ATTR_BGCOLOR24) {
+ if (bgcol24)
+ bg = bgcol24 << 8;
+ else
+ bg = COLOR_BLACK24;
+ } else
#endif
- ((col & BG_MASK) >> BG_SHIFT);
+ bg = ((col & BG_MASK) >> BG_SHIFT);
if (!term_use_colors && bg > 0)
col |= ATTR_REVERSE;
@@ -370,8 +380,10 @@ void term_set_color(TERM_WINDOW *window, int col)
(fg != 0 || (col & ATTR_RESETFG) == 0)) {
if (term_use_colors) {
last_fg = fg;
- if (!(fg & 0xff))
- termctl_set_color_24bit(0, last_fg >> 8);
+ if (fg >> 8)
+ termctl_set_color_24bit(0,
+ last_fg == COLOR_BLACK24 ? 0
+ : last_fg >> 8);
else
terminfo_set_fg(last_fg);
}
@@ -387,8 +399,10 @@ void term_set_color(TERM_WINDOW *window, int col)
(bg != 0 || (col & ATTR_RESETBG) == 0)) {
if (term_use_colors) {
last_bg = bg;
- if (!(bg & 0xff))
- termctl_set_color_24bit(1, last_bg >> 8);
+ if (bg >> 8)
+ termctl_set_color_24bit(1,
+ last_bg == COLOR_BLACK24 ? 0
+ : last_bg >> 8);
else
terminfo_set_bg(last_bg);
}
diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c
index 71828022..239c5a64 100644
--- a/src/irc/core/irc-commands.c
+++ b/src/irc/core/irc-commands.c
@@ -998,15 +998,11 @@ void irc_commands_init(void)
command_bind_irc("trace", NULL, (SIGNAL_FUNC) command_self);
/* SYNTAX: VERSION [<server>|<nick>] */
command_bind_irc("version", NULL, (SIGNAL_FUNC) command_self);
- /* SYNTAX: SERVLIST [<server mask>] */
- command_bind_irc("servlist", NULL, (SIGNAL_FUNC) command_self);
/* SYNTAX: SILENCE [[+|-]<nick!user@host>]
SILENCE [<nick>] */
command_bind_irc("silence", NULL, (SIGNAL_FUNC) command_self);
command_bind_irc("unsilence", NULL, (SIGNAL_FUNC) cmd_unsilence);
command_bind_irc("sconnect", NULL, (SIGNAL_FUNC) cmd_sconnect);
- /* SYNTAX: SQUERY <service> [<commands>] */
- command_bind_irc("squery", NULL, (SIGNAL_FUNC) command_2self);
/* SYNTAX: DIE */
command_bind_irc("die", NULL, (SIGNAL_FUNC) command_self);
/* SYNTAX: HASH */
@@ -1016,8 +1012,6 @@ void irc_commands_init(void)
command_bind_irc("restart", NULL, (SIGNAL_FUNC) command_self);
/* SYNTAX: SQUIT <server>|<mask> <reason> */
command_bind_irc("squit", NULL, (SIGNAL_FUNC) command_2self);
- /* SYNTAX: UPING <server> */
- command_bind_irc("uping", NULL, (SIGNAL_FUNC) command_self);
/* SYNTAX: USERHOST <nicks> */
command_bind_irc("userhost", NULL, (SIGNAL_FUNC) command_self);
command_bind_irc("quote", NULL, (SIGNAL_FUNC) cmd_quote);
@@ -1077,17 +1071,14 @@ void irc_commands_deinit(void)
command_unbind("time", (SIGNAL_FUNC) command_self);
command_unbind("trace", (SIGNAL_FUNC) command_self);
command_unbind("version", (SIGNAL_FUNC) command_self);
- command_unbind("servlist", (SIGNAL_FUNC) command_self);
command_unbind("silence", (SIGNAL_FUNC) command_self);
command_unbind("unsilence", (SIGNAL_FUNC) cmd_unsilence);
command_unbind("sconnect", (SIGNAL_FUNC) cmd_sconnect);
- command_unbind("squery", (SIGNAL_FUNC) command_2self);
command_unbind("die", (SIGNAL_FUNC) command_self);
command_unbind("hash", (SIGNAL_FUNC) command_self);
command_unbind("oper", (SIGNAL_FUNC) cmd_oper);
command_unbind("restart", (SIGNAL_FUNC) command_self);
command_unbind("squit", (SIGNAL_FUNC) command_2self);
- command_unbind("uping", (SIGNAL_FUNC) command_self);
command_unbind("userhost", (SIGNAL_FUNC) command_self);
command_unbind("quote", (SIGNAL_FUNC) cmd_quote);
command_unbind("wall", (SIGNAL_FUNC) cmd_wall);