[PATCH 12/25] efi-stdio: Fix tab printing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tabs are silently ignored by at least some UEFI instances. Replace them
with spaces in the output.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/serial/efi-stdio.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/efi-stdio.c b/drivers/serial/efi-stdio.c
index 9cc2ca4196..d99eca9d5e 100644
--- a/drivers/serial/efi-stdio.c
+++ b/drivers/serial/efi-stdio.c
@@ -320,7 +320,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]) {
@@ -333,6 +333,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++;
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux