Bug#710076: Ctrl-U copies byte-truncated UCS-4 to the kill buffer

Josh Triplett josh at joshtriplett.org
Tue May 28 04:27:21 UTC 2013


Package: grub-pc
Version: 2.00-14
Severity: normal
Tags: upstream patch

Hitting Ctrl-U deletes to the beginning of the line, but hitting Ctrl-Y
afterward yanks a truncated and mangled string.  Looking at the
code (in grub-core/normal/cmdline.c), it looks like the implementation
of Ctrl-U never got converted from 8-bit characters to UCS-4, so it only
copies N bytes rather than N characters.  The attached patch fixes this
problem.

Changelog entry for this patch:

2013-05-27  Josh Triplett  <josh at joshtriplett.org>

	* grub-core/normal/cmdline.c (grub_cmdline_get): Fix Ctrl-u
	handling to copy the killed characters to the kill buffer as
	UCS4 stored as grub_uint32_t rather than as 8-bit characters
	stored as char.  Eliminates UCS4 truncation and corruption
	observed when killing characters with Ctrl-u and yanking them
	back with Ctrl-y.

I've also attached the patch in "bzr send" form for direct application,
including the changelog entry.

- Josh Triplett

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.8-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]  1.5.50
ii  grub-common            2.00-14
ii  grub-pc-bin            2.00-14
ii  grub2-common           2.00-14
ii  ucf                    3.0027

grub-pc recommends no packages.

grub-pc suggests no packages.

-- debconf information excluded
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grub-ctrl-u-ucs4.patch
Type: text/x-diff
Size: 599 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20130527/dede55f7/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grub-ctrl-u-ucs4.bzr
Type: text/x-diff
Size: 3426 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20130527/dede55f7/attachment.diff>


More information about the Pkg-grub-devel mailing list