0013-don-t-print-empty-error-messages.patch 926 B

1234567891011121314151617181920212223242526272829303132
  1. From 031ee85c97452f6d1a5f341ff41c65aace5584c4 Mon Sep 17 00:00:00 2001
  2. From: Leah Rowe <leah@libreboot.org>
  3. Date: Sun, 5 Nov 2023 17:25:20 +0000
  4. Subject: [PATCH 13/14] don't print empty error messages
  5. this is part two of the quest to kill the prefix
  6. error message. after i disabled prefix-related
  7. messages, it still printed "error: ." on screen.
  8. Signed-off-by: Leah Rowe <leah@libreboot.org>
  9. ---
  10. grub-core/kern/err.c | 3 ++-
  11. 1 file changed, 2 insertions(+), 1 deletion(-)
  12. diff --git a/grub-core/kern/err.c b/grub-core/kern/err.c
  13. index 53c734de7..7cac53983 100644
  14. --- a/grub-core/kern/err.c
  15. +++ b/grub-core/kern/err.c
  16. @@ -107,7 +107,8 @@ grub_print_error (void)
  17. {
  18. if (grub_errno != GRUB_ERR_NONE)
  19. {
  20. - grub_err_printf (_("error: %s.\n"), grub_errmsg);
  21. + if (grub_strlen(grub_errmsg) > 0)
  22. + grub_err_printf (_("error: %s.\n"), grub_errmsg);
  23. grub_err_printed_errors++;
  24. }
  25. }
  26. --
  27. 2.39.2