Blame SOURCES/e2fsprogs-1.44.6-mke2fs-accept-the-english-yes-character-to-the-proce.patch

0ab26d
From 0e1bff5983c675544e79ee9e449e597f397c15b0 Mon Sep 17 00:00:00 2001
0ab26d
From: Theodore Ts'o <tytso@mit.edu>
0ab26d
Date: Mon, 27 May 2019 19:36:15 -0400
0ab26d
Subject: [PATCH] mke2fs: accept the english yes character to the proceed
0ab26d
 question
0ab26d
0ab26d
In some cases if the translation file is missing some translations,
0ab26d
mke2fs can end up printing an English message, e.g.:
0ab26d
0ab26d
% LANG=it_IT.UTF-8 ./mke2fs /tmp/foo.img 8M
0ab26d
mke2fs 1.45.1 (12-May-2019)
0ab26d
/tmp/foo.img contiene un file system ext4
0ab26d
	created on Mon May 27 19:35:48 2019
0ab26d
Proceed anyway? (y,N)
0ab26d
0ab26d
However, if there is a translation for string to match with "yY"
0ab26d
(e.g., to "sS" for Italian), then 'y' won't work.  Fix this by falling
0ab26d
back to the english 'yY' characters.
0ab26d
0ab26d
Addresses-Debian-Bug: #907034
0ab26d
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
0ab26d
---
0ab26d
 misc/util.c | 5 ++++-
0ab26d
 1 file changed, 4 insertions(+), 1 deletion(-)
0ab26d
0ab26d
diff --git a/misc/util.c b/misc/util.c
0ab26d
index 1d33883d..77991589 100644
0ab26d
--- a/misc/util.c
0ab26d
+++ b/misc/util.c
0ab26d
@@ -91,6 +91,7 @@ void proceed_question(int delay)
0ab26d
 {
0ab26d
 	char buf[256];
0ab26d
 	const char *short_yes = _("yY");
0ab26d
+	const char *english_yes = "yY";
0ab26d
 
0ab26d
 	fflush(stdout);
0ab26d
 	fflush(stderr);
0ab26d
@@ -108,7 +109,9 @@ void proceed_question(int delay)
0ab26d
 		fputs(_("Proceed anyway? (y,N) "), stdout);
0ab26d
 	buf[0] = 0;
0ab26d
 	if (!fgets(buf, sizeof(buf), stdin) ||
0ab26d
-	    strchr(short_yes, buf[0]) == 0) {
0ab26d
+	    strchr(_("nN"), buf[0]) ||
0ab26d
+	    !(strchr(short_yes, buf[0]) ||
0ab26d
+	      strchr(english_yes, buf[0]))) {
0ab26d
 		putc('\n', stdout);
0ab26d
 		exit(1);
0ab26d
 	}
0ab26d
-- 
0ab26d
2.20.1
0ab26d