Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tty: vt: fix up tabstops properly

Tabs on a console with long lines do not wrap properly, so correctly
account for the line length when computing the tab placement location.

Reported-by: James Holderness <j4_james@hotmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+4 -4
+4 -4
drivers/tty/vt/vt.c
··· 1727 1727 default_attr(vc); 1728 1728 update_attr(vc); 1729 1729 1730 - vc->vc_tab_stop[0] = 0x01010100; 1730 + vc->vc_tab_stop[0] = 1731 1731 vc->vc_tab_stop[1] = 1732 1732 vc->vc_tab_stop[2] = 1733 1733 vc->vc_tab_stop[3] = ··· 1771 1771 vc->vc_pos -= (vc->vc_x << 1); 1772 1772 while (vc->vc_x < vc->vc_cols - 1) { 1773 1773 vc->vc_x++; 1774 - if (vc->vc_tab_stop[vc->vc_x >> 5] & (1 << (vc->vc_x & 31))) 1774 + if (vc->vc_tab_stop[7 & (vc->vc_x >> 5)] & (1 << (vc->vc_x & 31))) 1775 1775 break; 1776 1776 } 1777 1777 vc->vc_pos += (vc->vc_x << 1); ··· 1831 1831 lf(vc); 1832 1832 return; 1833 1833 case 'H': 1834 - vc->vc_tab_stop[vc->vc_x >> 5] |= (1 << (vc->vc_x & 31)); 1834 + vc->vc_tab_stop[7 & (vc->vc_x >> 5)] |= (1 << (vc->vc_x & 31)); 1835 1835 return; 1836 1836 case 'Z': 1837 1837 respond_ID(tty); ··· 2024 2024 return; 2025 2025 case 'g': 2026 2026 if (!vc->vc_par[0]) 2027 - vc->vc_tab_stop[vc->vc_x >> 5] &= ~(1 << (vc->vc_x & 31)); 2027 + vc->vc_tab_stop[7 & (vc->vc_x >> 5)] &= ~(1 << (vc->vc_x & 31)); 2028 2028 else if (vc->vc_par[0] == 3) { 2029 2029 vc->vc_tab_stop[0] = 2030 2030 vc->vc_tab_stop[1] =