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



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to