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.
This commit is contained in:
Toomas Soome 2019-05-09 10:37:57 +00:00
parent e2eb11e577
commit 686d524bc9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=347388
2 changed files with 12 additions and 8 deletions

View file

@ -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');

View file

@ -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