summaryrefslogtreecommitdiffstats
path: root/util/miscutil.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1999-05-27 09:45:46 +0200
committerWerner Koch <wk@gnupg.org>1999-05-27 09:45:46 +0200
commita6a548ab56f931923ddf02c132aa202992445034 (patch)
tree283c44c6c1f9e51706f6f8f6884754623ef0dae3 /util/miscutil.c
parentSee ChangeLog: Wed May 26 14:36:29 CEST 1999 Werner Koch (diff)
downloadgnupg2-a6a548ab56f931923ddf02c132aa202992445034.tar.xz
gnupg2-a6a548ab56f931923ddf02c132aa202992445034.zip
See ChangeLog: Thu May 27 09:40:55 CEST 1999 Werner Koch
Diffstat (limited to '')
-rw-r--r--util/miscutil.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/util/miscutil.c b/util/miscutil.c
index d902ae435..d982e64af 100644
--- a/util/miscutil.c
+++ b/util/miscutil.c
@@ -164,3 +164,26 @@ answer_is_yes( const char *s )
}
+/****************
+ * Return 1 for yes, -1 for quit, or 0 for no
+ */
+int
+answer_is_yes_no_quit( const char *s )
+{
+ char *long_yes = _("yes");
+ char *long_quit = _("quit");
+ char *short_yes = _("yY");
+ char *short_quit = _("qQ");
+
+ if( !stricmp(s, long_yes ) )
+ return 1;
+ if( !stricmp(s, long_quit ) )
+ return -1;
+ if( strchr( short_yes, *s ) && !s[1] )
+ return 1;
+ if( strchr( short_quit, *s ) && !s[1] )
+ return -1;
+ return 0;
+}
+
+