From: Theodore Ts'o Date: Mon, 27 May 2019 23:36:15 +0000 (-0400) Subject: mke2fs: accept the english yes character to the proceed question X-Git-Tag: v1.45.2~2 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=0e0dad426a9f74ccd764071e6710084fc1a2cd31;p=tools%2Fe2fsprogs.git mke2fs: accept the english yes character to the proceed question In some cases if the translation file is missing some translations, mke2fs can end up printing an English message, e.g.: % LANG=it_IT.UTF-8 ./mke2fs /tmp/foo.img 8M mke2fs 1.45.1 (12-May-2019) /tmp/foo.img contiene un file system ext4 created on Mon May 27 19:35:48 2019 Proceed anyway? (y,N) However, if there is a translation for string to match with "yY" (e.g., to "sS" for Italian), then 'y' won't work. Fix this by falling back to the english 'yY' characters. Addresses-Debian-Bug: #907034 Signed-off-by: Theodore Ts'o --- diff --git a/misc/util.c b/misc/util.c index 1d33883..7799158 100644 --- a/misc/util.c +++ b/misc/util.c @@ -91,6 +91,7 @@ void proceed_question(int delay) { char buf[256]; const char *short_yes = _("yY"); + const char *english_yes = "yY"; fflush(stdout); fflush(stderr); @@ -108,7 +109,9 @@ void proceed_question(int delay) fputs(_("Proceed anyway? (y,N) "), stdout); buf[0] = 0; if (!fgets(buf, sizeof(buf), stdin) || - strchr(short_yes, buf[0]) == 0) { + strchr(_("nN"), buf[0]) || + !(strchr(short_yes, buf[0]) || + strchr(english_yes, buf[0]))) { putc('\n', stdout); exit(1); }