1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Sebastien Helleu a198d22213 Version 0.3.9.1 2012-11-09 19:24:13 +01:00
Sebastien Helleu 80f477f2c3 irc: fix crash when decoding IRC colors in strings (bug #37704) 2012-11-09 18:53:04 +01:00
16 changed files with 87 additions and 43 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ ENDIF(PREFIX)
SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "3")
SET(VERSION_PATCH "9")
SET(VERSION_PATCH "9.1")
SET(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
SET(LICENSE "GPL3")
SET(PKG_STRING "${PROJECT_NAME} ${VERSION}")
+6 -1
View File
@@ -1,9 +1,14 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.9, 2012-09-29
v0.3.9.1, 2012-11-09
Version 0.3.9.1 (2012-11-09)
----------------------------
* irc: fix crash when decoding IRC colors in strings (bug #37704)
Version 0.3.9 (2012-09-29)
--------------------------
+6 -1
View File
@@ -1,9 +1,14 @@
WeeChat Release Notes
=====================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.9, 2012-09-29
v0.3.9.1, 2012-11-09
Version 0.3.9.1 (2012-11-09)
----------------------------
This version fixes crash when decoding IRC colors in strings.
Version 0.3.9 (2012-09-29)
--------------------------
+2 -2
View File
@@ -24,10 +24,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.3.9, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.3.9.1, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/core/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.3.9])
AM_INIT_AUTOMAKE([weechat], [0.3.9.1])
LICENSE="GPL3"
# Checks for programs
+2 -2
View File
@@ -18,10 +18,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9\n"
"Project-Id-Version: WeeChat 0.3.9.1\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-09-29 09:37+0200\n"
"PO-Revision-Date: 2012-09-29 09:23+0200\n"
"PO-Revision-Date: 2012-11-09 18:36+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: Czech\n"
+2 -2
View File
@@ -21,10 +21,10 @@
# nils, 2012.
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9\n"
"Project-Id-Version: WeeChat 0.3.9.1\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-09-29 09:37+0200\n"
"PO-Revision-Date: 2012-09-29 09:24+0200\n"
"PO-Revision-Date: 2012-11-09 18:36+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
"Language: \n"
+2 -2
View File
@@ -20,10 +20,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9\n"
"Project-Id-Version: WeeChat 0.3.9.1\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-09-29 09:37+0200\n"
"PO-Revision-Date: 2012-09-29 09:24+0200\n"
"PO-Revision-Date: 2012-11-09 18:36+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: Spanish\n"
+2 -2
View File
@@ -19,10 +19,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9\n"
"Project-Id-Version: WeeChat 0.3.9.1\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-09-29 09:37+0200\n"
"PO-Revision-Date: 2012-09-29 09:24+0200\n"
"PO-Revision-Date: 2012-11-09 18:36+0100\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
+2 -2
View File
@@ -18,10 +18,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9\n"
"Project-Id-Version: WeeChat 0.3.9.1\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-09-29 09:37+0200\n"
"PO-Revision-Date: 2012-09-29 09:24+0200\n"
"PO-Revision-Date: 2012-11-09 18:36+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: Hungarian\n"
+2 -2
View File
@@ -18,10 +18,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9\n"
"Project-Id-Version: WeeChat 0.3.9.1\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-09-29 09:37+0200\n"
"PO-Revision-Date: 2012-09-29 09:25+0200\n"
"PO-Revision-Date: 2012-11-09 18:36+0100\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: Italian\n"
+2 -2
View File
@@ -18,10 +18,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9\n"
"Project-Id-Version: WeeChat 0.3.9.1\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-09-29 09:37+0200\n"
"PO-Revision-Date: 2012-09-29 09:25+0200\n"
"PO-Revision-Date: 2012-11-09 18:36+0100\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
"Language: ja\n"
+2 -2
View File
@@ -19,10 +19,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9\n"
"Project-Id-Version: WeeChat 0.3.9.1\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-09-29 09:37+0200\n"
"PO-Revision-Date: 2012-09-29 09:25+0200\n"
"PO-Revision-Date: 2012-11-09 18:36+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: Polish\n"
+2 -2
View File
@@ -19,10 +19,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9\n"
"Project-Id-Version: WeeChat 0.3.9.1\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-09-29 09:37+0200\n"
"PO-Revision-Date: 2012-09-29 09:25+0200\n"
"PO-Revision-Date: 2012-11-09 18:36+0100\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: Portuguese\n"
+2 -2
View File
@@ -19,10 +19,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9\n"
"Project-Id-Version: WeeChat 0.3.9.1\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-09-29 09:37+0200\n"
"PO-Revision-Date: 2012-09-29 09:25+0200\n"
"PO-Revision-Date: 2012-11-09 18:36+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: Russian\n"
+49 -17
View File
@@ -62,13 +62,15 @@ char *irc_color_to_weechat[IRC_NUM_COLORS] =
char *
irc_color_decode (const char *string, int keep_colors)
{
unsigned char *out, *ptr_string;
int out_length, length, out_pos;
char str_fg[3], str_bg[3], str_color[128], str_key[128];
unsigned char *out, *out2, *ptr_string;
int out_length, length, out_pos, length_to_add;
char str_fg[3], str_bg[3], str_color[128], str_key[128], str_to_add[128];
const char *remapped_color;
int fg, bg, bold, reverse, italic, underline, rc;
out_length = (strlen (string) * 2) + 1;
if (out_length < 128)
out_length = 128;
out = malloc (out_length);
if (!out)
return NULL;
@@ -80,20 +82,27 @@ irc_color_decode (const char *string, int keep_colors)
ptr_string = (unsigned char *)string;
out[0] = '\0';
out_pos = 0;
while (ptr_string && ptr_string[0])
{
str_to_add[0] = '\0';
switch (ptr_string[0])
{
case IRC_COLOR_BOLD_CHAR:
if (keep_colors)
strcat ((char *)out,
weechat_color((bold) ? "-bold" : "bold"));
{
snprintf (str_to_add, sizeof (str_to_add), "%s",
weechat_color ((bold) ? "-bold" : "bold"));
}
bold ^= 1;
ptr_string++;
break;
case IRC_COLOR_RESET_CHAR:
if (keep_colors)
strcat ((char *)out, weechat_color("reset"));
{
snprintf (str_to_add, sizeof (str_to_add), "%s",
weechat_color ("reset"));
}
bold = 0;
reverse = 0;
italic = 0;
@@ -106,22 +115,28 @@ irc_color_decode (const char *string, int keep_colors)
case IRC_COLOR_REVERSE_CHAR:
case IRC_COLOR_REVERSE2_CHAR:
if (keep_colors)
strcat ((char *)out,
weechat_color((reverse) ? "-reverse" : "reverse"));
{
snprintf (str_to_add, sizeof (str_to_add), "%s",
weechat_color ((reverse) ? "-reverse" : "reverse"));
}
reverse ^= 1;
ptr_string++;
break;
case IRC_COLOR_ITALIC_CHAR:
if (keep_colors)
strcat ((char *)out,
weechat_color((italic) ? "-italic" : "italic"));
{
snprintf (str_to_add, sizeof (str_to_add), "%s",
weechat_color ((italic) ? "-italic" : "italic"));
}
italic ^= 1;
ptr_string++;
break;
case IRC_COLOR_UNDERLINE_CHAR:
if (keep_colors)
strcat ((char *)out,
weechat_color((underline) ? "-underline" : "underline"));
{
snprintf (str_to_add, sizeof (str_to_add), "%s",
weechat_color ((underline) ? "-underline" : "underline"));
}
underline ^= 1;
ptr_string++;
break;
@@ -194,22 +209,39 @@ irc_color_decode (const char *string, int keep_colors)
(bg >= 0) ? "," : "",
(bg >= 0) ? irc_color_to_weechat[bg] : "");
}
strcat ((char *)out, weechat_color(str_color));
snprintf (str_to_add, sizeof (str_to_add), "%s",
weechat_color (str_color));
}
else
strcat ((char *)out, weechat_color("resetcolor"));
{
snprintf (str_to_add, sizeof (str_to_add), "%s",
weechat_color ("resetcolor"));
}
}
break;
default:
length = weechat_utf8_char_size ((char *)ptr_string);
if (length == 0)
length = 1;
out_pos = strlen ((char *)out);
memcpy (out + out_pos, ptr_string, length);
out[out_pos + length] = '\0';
memcpy (str_to_add, ptr_string, length);
str_to_add[length] = '\0';
ptr_string += length;
break;
}
if (str_to_add[0])
{
length_to_add = strlen (str_to_add);
if (out_pos + length_to_add >= out_length)
{
out_length *= 2;
out2 = realloc (out, out_length);
if (!out2)
return (char *)out;
out = out2;
}
memcpy (out + out_pos, str_to_add, length_to_add + 1);
out_pos += length_to_add;
}
}
return (char *)out;
+3 -1
View File
@@ -23,7 +23,7 @@
#
%define name weechat
%define version 0.3.9
%define version 0.3.9.1
%define release 1
Name: %{name}
@@ -73,6 +73,8 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/%{name}/weechat-plugin.h
%changelog
* Fri Nov 09 2012 Sebastien Helleu <flashcode@flashtux.org> 0.3.9.1-1
- Released version 0.3.9.1
* Sat Sep 29 2012 Sebastien Helleu <flashcode@flashtux.org> 0.3.9-1
- Released version 0.3.9
* Sun Jun 03 2012 Sebastien Helleu <flashcode@flashtux.org> 0.3.8-1