bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bash-testers] Re: readline-5.2-1 prompt issue on cygwin


From: Eric Blake
Subject: Re: [bash-testers] Re: readline-5.2-1 prompt issue on cygwin
Date: Thu, 09 Nov 2006 22:10:37 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Thunderbird/1.5.0.8 Mnenhy/0.7.4.666

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

According to Eric Blake on 11/9/2006 10:04 PM:
> 
> This patch fixes this particular test case for me, but I have no idea if
> it is correct or breaks something else.  The idea is that even when
> MB_CUR_MAX == 1, the cursor absolute position as calculated by
> _rl_col_width might not be accurate in the presence of invisible
> characters passed to mbrtowc.  Perhaps an alternative patch would be to
> update _rl_col_width to do naive processing when MB_CUR_MAX == 1 in order
> to match the assumptions of the rest of readline.

Indeed, this alternative patch also seems to fix the test case for me:

- --- bash-3.2-orig/lib/readline/display.c   2006-09-14 12:20:12.000000000
-0600
+++ bash-3.2/lib/readline/display.c     2006-11-09 22:08:26.249000000 -0700
@@ -2380,6 +2380,8 @@ _rl_col_width (str, start, end)

   if (end <= start)
     return 0;
+  if (MB_CUR_MAX == 1)
+    return end - start;

   memset (&ps, 0, sizeof (mbstate_t));


- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFVAnN84KuGfSFAYARAlAMAJ4zLgK8KuU6aEkv0b0YqsydwLxckgCeM2Gn
vs/nh6cWKyg/ZdE4sYz2FeM=
=P2Jp
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]