nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0210-Suppress-gettext-error-message.patch

5593c8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
5593c8
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
5593c8
Date: Tue, 29 Jun 2021 13:17:42 +0200
5593c8
Subject: [PATCH] Suppress gettext error message
5593c8
5593c8
Colin Watson's patch from comment #11 on the upstream bug:
5593c8
https://savannah.gnu.org/bugs/?35880#comment11
5593c8
5593c8
Resolves: rhbz#1592124
5593c8
5593c8
Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
5593c8
---
5593c8
 grub-core/gettext/gettext.c | 7 +++++++
5593c8
 1 file changed, 7 insertions(+)
5593c8
5593c8
diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c
5593c8
index 84d520cd494..87a912ac6e5 100644
5593c8
--- a/grub-core/gettext/gettext.c
5593c8
+++ b/grub-core/gettext/gettext.c
5593c8
@@ -424,6 +424,13 @@ grub_gettext_init_ext (struct grub_gettext_context *ctx,
5593c8
       grub_free (lang);
5593c8
     }
5593c8
 
5593c8
+  /* If no translations are available, fall back to untranslated text. */
5593c8
+  if (err == GRUB_ERR_FILE_NOT_FOUND)
5593c8
+    {
5593c8
+      grub_errno = GRUB_ERR_NONE;
5593c8
+      return 0;
5593c8
+    }
5593c8
+
5593c8
   if (locale[0] == 'e' && locale[1] == 'n'
5593c8
       && (locale[2] == '\0' || locale[2] == '_'))
5593c8
     grub_errno = err = GRUB_ERR_NONE;