Bug#197416: detailed problem description and a patch (workaround)

Josselin Mouette Josselin Mouette <joss@debian.org>, 197416@bugs.debian.org
Fri, 20 Feb 2004 23:23:01 +0100


--=-DcXBGgUbHKeHgkc2sqjj
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

unmerge 197416
reassign 197416 libpopt0
tag 197416 patch
thanks

Le jeu 05/02/2004 =E0 18:20, Sergey Spiridonov a =E9crit :
> Hi,
>=20
> After hacking a bit, I found out, that the problem is caused by libpopt.
>=20
> Libpopt uses char to calculate line lengths (it needs to calculate line
> lengths because of the wrapping it does during help output). Libpopt=20
> assumes 79 chars as maximum width of the line on the screen. It looks=20
> for the option+description with maximum length in chars.
>=20
> It is already wrong, since Russian text uses UTF-8, and in UTF-8 four=20
> chars(bytes) can be displayed as one character on the screen. Anyway,
> after finding out the length, libpopt calculates some offsets. The
> offset becomes negative. This negative value is used for mallocs,=20
> pointer arithmetics and so on.
>=20
> The patch below, just fixes the line, where the offset becomes negative,
> so gconftool-2 does not produce megabytes of garbage on stdout.
> It is not best solution. The best solution will be to
> 1. rewrite libopt to handle UTF-8 properly (for example using wchar)
> and
> 2. rewrite help output formatting (with the attached patch Russian help
> will not be formatted very nice).

OK, reassigning to libpopt0.

Regards,
--=20
 .''`.           Josselin Mouette        /\./\
: :' :           josselin.mouette@ens-lyon.org
`. `'                        joss@debian.org
  `-  Debian GNU/Linux -- The power of freedom

--=-DcXBGgUbHKeHgkc2sqjj
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Ceci est une partie de message
	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e=2E?=

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

iD8DBQBANojErSla4ddfhTMRAg2jAJ9ttftJqZCs+AW77Of9vbu4uzU+LQCg+JNs
Oud1B/Qq29E1wSWm3ulQF4Q=
=TtI+
-----END PGP SIGNATURE-----

--=-DcXBGgUbHKeHgkc2sqjj--