diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-12-10 11:40:28 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-12-13 23:37:32 +0100 |
commit | 8891e8157c773c7f54afd828f3ab78b2b898256a (patch) | |
tree | 37d40017956f9d1ef740958594154b0d5131ddd6 /drivers/serial | |
parent | 008af161010e78636c701e9f462df06515415518 (diff) | |
download | barebox-8891e8157c773c7f54afd828f3ab78b2b898256a.tar.gz barebox-8891e8157c773c7f54afd828f3ab78b2b898256a.tar.xz |
efi-stdio: Fix tab printing
Tabs are silently ignored by at least some UEFI instances. Replace them
with spaces in the output.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/efi-stdio.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/serial/efi-stdio.c b/drivers/serial/efi-stdio.c index ef7dc77964..c5258e3f65 100644 --- a/drivers/serial/efi-stdio.c +++ b/drivers/serial/efi-stdio.c @@ -279,7 +279,7 @@ static int efi_console_puts(struct console_device *cdev, const char *s, size_t nbytes) { struct efi_console_priv *priv = to_efi(cdev); - int pos = 0; + int n, pos = 0; while (pos < nbytes) { switch (s[pos]) { @@ -292,6 +292,13 @@ static int efi_console_puts(struct console_device *cdev, const char *s, efi_console_add_char(priv, '\n'); pos++; break; + case '\t': + efi_console_flush(priv); + n = 8 - priv->out->mode->cursor_column % 8; + while (n--) + efi_console_add_char(priv, ' '); + pos++; + break; default: efi_console_add_char(priv, s[pos]); pos++; |