From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL autolearn=no version=3.2.5 Message-ID: <4A041060.5000604@gmail.com> Date: Fri, 08 May 2009 14:58:40 +0400 From: Alexey Gladkov User-Agent: Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.8.1.18) Gecko/20081202 Thunderbird/2.0.0.18 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: Linux console tools development discussion References: <20090506190608.GA4840@graeme> In-Reply-To: <20090506190608.GA4840@graeme> X-Enigmail-Version: 0.96a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [kbd] Pull request for auto-convert-keymaps X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2009 10:59:33 -0000 Archived-At: List-Archive: On 06.05.2009 23:06, Michael Schutte wrote: > Hey, > > May I ask you to > > git pull git://git.debian.org/pkg-kbd/kbd.git auto-convert-keymaps > > into your auto-convert-keymaps branch? This is the one-line log: > > 5aa247b Regenerate analyze.c and loadkeys.c > 18eadfe Support Unicode compose tables > b9f77f5 Support bidirectional conversion of keysyms +/* Directions for converting keysyms */ +#define TO_AUTO (-1) /* use prefer_unicode */ +#define TO_8BIT 0 +#define TO_UNICODE 1 ... + else if (direction == (code >= 0x1000)) + result = code; /* no conversion necessary */ + else if (code < 0x80) + result = direction ? (code ^ 0xf000) : code; + else if ((code ^ 0xf000) < 0x80) + result = direction ? code : (code ^ 0xf000); I almost broke the brain by reading it. You call convert_code() with TO_{AUTO,8BIT,UNICODE} , but you do not using these definition in this function. > 68cbd1c Fix two problems with the keymap auto-conversion patch @@ -1695,6 +1696,8 @@ set_charset(const char *charset) { if(p->name[0]) syms[0].table[i] = p->name; } + if (chosen_charset) + free(chosen_charset); chosen_charset = strdup(charset); return 0; } You fixed memory leak, but still have not released memory in all the programs that use set_charset(). -- Rgrds, legion