nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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