summaryrefslogtreecommitdiff
path: root/mh
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-01-05 18:09:32 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-01-05 18:09:32 +0000
commite8548a14f1268da5cefe45656c7518148a504c75 (patch)
treed0419987bba42bbc5ad51e4caa0337c73723ff21 /mh
parentd12f61a65fbd800b1b74b7ee1d1bd8bbf9950cc7 (diff)
downloadmailutils-e8548a14f1268da5cefe45656c7518148a504c75.tar.gz
mailutils-e8548a14f1268da5cefe45656c7518148a504c75.tar.bz2
Use mu_true_answer_p()
Diffstat (limited to 'mh')
-rw-r--r--mh/mh.h2
-rw-r--r--mh/mh_init.c18
2 files changed, 8 insertions, 12 deletions
diff --git a/mh/mh.h b/mh/mh.h
index 63f2220ed..c9d9c1135 100644
--- a/mh/mh.h
+++ b/mh/mh.h
@@ -63,7 +63,7 @@ extern char *strchrnul __P((const char *s, int c_in));
#define MH_CONTEXT_FILE "context"
#define DEFAULT_ALIAS_FILE MHLIBDIR "/MailAliases"
-#define is_true(arg) ((arg)==NULL||(arg)[0] == 'y')
+#define is_true(arg) ((arg) == NULL||mu_true_answer_p (arg) == 1)
enum mh_opcode
{
diff --git a/mh/mh_init.c b/mh/mh_init.c
index db011fdbd..e4e7ffe93 100644
--- a/mh/mh_init.c
+++ b/mh/mh_init.c
@@ -256,7 +256,7 @@ mh_vgetyn (const char *fmt, va_list ap)
while (1)
{
char *p;
- int len;
+ int len, rc;
vfprintf (stdout, fmt, ap);
fprintf (stdout, "? ");
@@ -269,17 +269,13 @@ mh_vgetyn (const char *fmt, va_list ap)
while (*p && isspace (*p))
p++;
-
- switch (p[0])
- {
- case 'y':
- case 'Y':
- return 1;
- case 'n':
- case 'N':
- return 0;
- }
+ rc = mu_true_answer_p (p);
+
+ if (rc >= 0)
+ return rc;
+
+ /* TRANSLATORS: See msgids "nN" and "yY". */
fprintf (stdout, _("Please answer yes or no: "));
}
return 0; /* to pacify gcc */

Return to:

Send suggestions and report system problems to the System administrator.