Debian Bug report logs - #332635
libreadline5: readline works incorrectly with non-ASCII input

version graph

Package: libreadline5; Maintainer for libreadline5 is Debian QA Group <packages@qa.debian.org>; Source for libreadline5 is src:readline5 (PTS, buildd, popcon).

Reported by: cheusov@scnsoft.com

Date: Fri, 7 Oct 2005 13:18:02 UTC

Severity: normal

Tags: patch, upstream

Found in version libreadline5/5.0-10

Fixed in version readline5/5.1-1

Done: Matthias Klose <doko@debian.org>

Bug is archived. No further changes may be made.

Forwarded to chet@case.edu

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Aleksey Cheusov <cheusov@scnsoft.com>, Matthias Klose <doko@debian.org>:
Bug#332635; Package libreadline5. (full text, mbox, link).


Acknowledgement sent to cheusov@scnsoft.com:
New Bug report received and forwarded. Copy sent to Aleksey Cheusov <cheusov@scnsoft.com>, Matthias Klose <doko@debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: cheusov@scnsoft.com
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libreadline5: readline works incorrectly with non-ASCII input
Date: 7 Oct 2005 16:01:59 +0300
Package: libreadline5
Version: 5.0-10
Severity: normal
Tags: patch, upstream

M-b, M-f, M-u, M-l and other keys strokes
do not work properly with non-ASCII input.

This is because isalpha, isalnum,... tolower and toupper function
handles correctly only ASCII characters.
Another bug is in that '(char) 255' is passed to all these functions.
Because 'char == signed char', '(char) 255' is treated as -1 which is equal
to EOF constant.
As a result, when working in CP1251 coding system, the lowercase russian
charter YA is processed incorrectly.
The coding systems KOI8-R and ISO-8859-5 are also affected.

The patch below fixes these bugs.
Please forward it to upstream.

Also see bugs #329917 and #200871

diff -Nur readline5-5.0.orig/chardefs.h /var/local/src/local-src/readline5-5.0/chardefs.h
--- readline5-5.0.orig/chardefs.h       2003-02-02 00:43:47.000000000 +0200
+++ /var/local/src/local-src/readline5-5.0/chardefs.h   2005-10-07 15:27:01.000000000 +0300
@@ -24,6 +24,7 @@
 #define _CHARDEFS_H_
 
 #include <ctype.h>
+#include "rlmbutil.h"
 
 #if defined (HAVE_CONFIG_H)
 #  if defined (HAVE_STRING_H)
@@ -86,24 +87,24 @@
 /* Some systems define these; we want our definitions. */
 #undef ISPRINT
 
-#define ISALNUM(c)     (IN_CTYPE_DOMAIN (c) && isalnum (c))
-#define ISALPHA(c)     (IN_CTYPE_DOMAIN (c) && isalpha (c))
-#define ISDIGIT(c)     (IN_CTYPE_DOMAIN (c) && isdigit (c))
-#define ISLOWER(c)     (IN_CTYPE_DOMAIN (c) && islower (c))
-#define ISPRINT(c)     (IN_CTYPE_DOMAIN (c) && isprint (c))
-#define ISUPPER(c)     (IN_CTYPE_DOMAIN (c) && isupper (c))
-#define ISXDIGIT(c)    (IN_CTYPE_DOMAIN (c) && isxdigit (c))
+#define ISALNUM(c)     ((MB_CUR_MAX == 1 || IN_CTYPE_DOMAIN (c)) && isalnum ((unsigned char) c))
+#define ISALPHA(c)     ((MB_CUR_MAX == 1 || IN_CTYPE_DOMAIN (c)) && isalpha ((unsigned char) c))
+#define ISDIGIT(c)     ((MB_CUR_MAX == 1 || IN_CTYPE_DOMAIN (c)) && isdigit ((unsigned char) c))
+#define ISLOWER(c)     ((MB_CUR_MAX == 1 || IN_CTYPE_DOMAIN (c)) && islower ((unsigned char) c))
+#define ISPRINT(c)     ((MB_CUR_MAX == 1 || IN_CTYPE_DOMAIN (c)) && isprint ((unsigned char) c))
+#define ISUPPER(c)     ((MB_CUR_MAX == 1 || IN_CTYPE_DOMAIN (c)) && isupper ((unsigned char) c))
+#define ISXDIGIT(c)    ((MB_CUR_MAX == 1 || IN_CTYPE_DOMAIN (c)) && isxdigit ((unsigned char) c))
 
-#define _rl_lowercase_p(c)     (NON_NEGATIVE(c) && ISLOWER(c))
-#define _rl_uppercase_p(c)     (NON_NEGATIVE(c) && ISUPPER(c))
+#define _rl_lowercase_p(c)     (ISLOWER(c))
+#define _rl_uppercase_p(c)     (ISUPPER(c))
 #define _rl_digit_p(c)         ((c) >= '0' && (c) <= '9')
 
-#define _rl_pure_alphabetic(c) (NON_NEGATIVE(c) && ISALPHA(c))
-#define ALPHABETIC(c)          (NON_NEGATIVE(c) && ISALNUM(c))
+#define _rl_pure_alphabetic(c) (ISALPHA(c))
+#define ALPHABETIC(c)          (ISALNUM(c))
 
 #ifndef _rl_to_upper
-#  define _rl_to_upper(c) (_rl_lowercase_p(c) ? toupper((unsigned char)c) : (c))
-#  define _rl_to_lower(c) (_rl_uppercase_p(c) ? tolower((unsigned char)c) : (c))
+#  define _rl_to_upper(c) (_rl_lowercase_p(c) ? toupper((unsigned char)c) : ((unsigned char) c))
+#  define _rl_to_lower(c) (_rl_uppercase_p(c) ? tolower((unsigned char)c) : ((unsigned char) c))
 #endif
 
 #ifndef _rl_digit_value

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.11-1-686
Locale: LANG=ru_RU.CP1251, LC_CTYPE=ru_RU.CP1251 (charmap=CP1251)

Versions of packages libreadline5 depends on:
ii  libc6                         2.3.5-6    GNU C Library: Shared libraries an
ii  libncurses5                   5.4-9      Shared libraries for terminal hand

libreadline5 recommends no packages.

-- no debconf information




Tags added: upstream Request was from Matthias Klose <doko@cs.tu-berlin.de> to control@bugs.debian.org. (full text, mbox, link).


Noted your statement that Bug has been forwarded to chet@case.edu. Request was from Matthias Klose <doko@cs.tu-berlin.de> to control@bugs.debian.org. (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#332635; Package libreadline5. (full text, mbox, link).


Acknowledgement sent to chet.ramey@case.edu:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (full text, mbox, link).


Message #14 received at 332635@bugs.debian.org (full text, mbox, reply):

From: Chet Ramey <chet.ramey@case.edu>
To: Aleksey Cheusov <cheusov@scnsoft.com>, 332635@bugs.debian.org
Subject: Re: Bug#332635: libreadline5: readline works incorrectly with non-ASCII input (forwarded from cheusov@scnsoft.com)
Date: Fri, 11 Nov 2005 16:00:12 -0500
Matthias Klose wrote:
> 
> ------------------------------------------------------------------------
> 
> Subject:
> Bug#332635: libreadline5: readline works incorrectly with non-ASCII input

This is fixed the right way in readline-5.1.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
						Live Strong.
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



Reply sent to Matthias Klose <doko@debian.org>:
You have taken responsibility. (full text, mbox, link).


Notification sent to cheusov@scnsoft.com:
Bug acknowledged by developer. (full text, mbox, link).


Message #19 received at 332635-close@bugs.debian.org (full text, mbox, reply):

From: Matthias Klose <doko@debian.org>
To: 332635-close@bugs.debian.org
Subject: Bug#332635: fixed in readline5 5.1-1
Date: Fri, 09 Dec 2005 13:47:19 -0800
Source: readline5
Source-Version: 5.1-1

We believe that the bug you reported is fixed in the latest version of
readline5, which is due to be installed in the Debian FTP archive:

libreadline5-dbg_5.1-1_i386.deb
  to pool/main/r/readline5/libreadline5-dbg_5.1-1_i386.deb
libreadline5-dev_5.1-1_i386.deb
  to pool/main/r/readline5/libreadline5-dev_5.1-1_i386.deb
libreadline5_5.1-1_i386.deb
  to pool/main/r/readline5/libreadline5_5.1-1_i386.deb
readline-common_5.1-1_all.deb
  to pool/main/r/readline5/readline-common_5.1-1_all.deb
readline5_5.1-1.diff.gz
  to pool/main/r/readline5/readline5_5.1-1.diff.gz
readline5_5.1-1.dsc
  to pool/main/r/readline5/readline5_5.1-1.dsc
readline5_5.1.orig.tar.gz
  to pool/main/r/readline5/readline5_5.1.orig.tar.gz
rlfe_5.1-1_i386.deb
  to pool/main/r/readline5/rlfe_5.1-1_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 332635@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <doko@debian.org> (supplier of updated readline5 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Fri,  9 Dec 2005 21:22:24 +0100
Source: readline5
Binary: lib64readline5 libreadline5 readline-common rlfe lib64readline5-dev libreadline5-dev libreadline5-dbg
Architecture: source i386 all
Version: 5.1-1
Distribution: unstable
Urgency: low
Maintainer: Matthias Klose <doko@debian.org>
Changed-By: Matthias Klose <doko@debian.org>
Description: 
 libreadline5 - GNU readline and history libraries, run-time libraries
 libreadline5-dbg - GNU readline and history libraries, debugging libraries
 libreadline5-dev - GNU readline and history libraries, development files
 readline-common - GNU readline and history libraries, common files
 rlfe       - A front-end using readline to "cook" input lines for other progra
Closes: 332635 339452
Changes: 
 readline5 (5.1-1) unstable; urgency=low
 .
   * New upstream version (5.1 release).
     - Works better with non-ASCII input (closes: #332635).
   * readline-common conflicts/replaces libreadline-common (closes: #339452).
Files: 
 af3417328484bdf7604931a3f4fefc40 752 base standard readline5_5.1-1.dsc
 7ee5a692db88b30ca48927a13fd60e46 2030276 base standard readline5_5.1.orig.tar.gz
 fd42364e9ca23ef7205ea36b216003bd 14893 base standard readline5_5.1-1.diff.gz
 d51a73491b153dd47f5437e27d90be72 49784 base standard readline-common_5.1-1_all.deb
 f2b3f73606b73cbb49b5598b3fe9d275 123454 libs standard libreadline5_5.1-1_i386.deb
 5456bbde4d2ab24c5c8a8437120e500c 219506 libdevel optional libreadline5-dev_5.1-1_i386.deb
 b0646193b5a1c4fd571e69db4f61a9af 238998 libdevel extra libreadline5-dbg_5.1-1_i386.deb
 356527e7ef210cb2bc3bd0258469857f 15882 utils optional rlfe_5.1-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDmfFmStlRaw+TLJwRAhLiAKCLwaUoviPw7N6m4GtIrbt+CFDAKACgrhf3
aGv5lmfRhAy909+3G9Brwz0=
=4U4J
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 25 Jun 2007 04:59:33 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Tue Jul 2 22:53:15 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.