Date: Thu, 9 May 2019 10:37:57 +0000 (UTC) From: Toomas Soome <tsoome@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347388 - in head/stand: efi/libefi i386/libi386 Message-ID: <201905091037.x49AbvXW015627@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tsoome Date: Thu May 9 10:37:57 2019 New Revision: 347388 URL: https://svnweb.freebsd.org/changeset/base/347388 Log: loader: implement proper 8 char tab stops The current console code is printing out 8 spaces for tab, calculate the amount of spaces based on tab stops. Modified: head/stand/efi/libefi/efi_console.c head/stand/i386/libi386/vidconsole.c Modified: head/stand/efi/libefi/efi_console.c ============================================================================== --- head/stand/efi/libefi/efi_console.c Thu May 9 10:23:42 2019 (r347387) +++ head/stand/efi/libefi/efi_console.c Thu May 9 10:37:57 2019 (r347388) @@ -135,11 +135,13 @@ efi_cons_rawputchar(int c) UINTN x, y; conout->QueryMode(conout, conout->Mode->Mode, &x, &y); - if (c == '\t') - /* XXX lame tab expansion */ - for (i = 0; i < 8; i++) + if (c == '\t') { + int n; + + n = 8 - ((curx + 8) % 8); + for (i = 0; i < n; i++) efi_cons_rawputchar(' '); - else { + } else { #ifndef TERM_EMU if (c == '\n') efi_cons_efiputchar('\r'); Modified: head/stand/i386/libi386/vidconsole.c ============================================================================== --- head/stand/i386/libi386/vidconsole.c Thu May 9 10:23:42 2019 (r347387) +++ head/stand/i386/libi386/vidconsole.c Thu May 9 10:37:57 2019 (r347388) @@ -136,11 +136,13 @@ vidc_rawputchar(int c) { int i; - if (c == '\t') - /* lame tab expansion */ - for (i = 0; i < 8; i++) + if (c == '\t') { + int n; + + n = 8 - ((curx + 8) % 8); + for (i = 0; i < n; i++) vidc_rawputchar(' '); - else { + } else { #ifndef TERM_EMU vidc_biosputchar(c); #else
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905091037.x49AbvXW015627>