diff options
author | Werner Koch <[email protected]> | 1999-05-27 07:45:46 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1999-05-27 07:45:46 +0000 |
commit | a6a548ab56f931923ddf02c132aa202992445034 (patch) | |
tree | 283c44c6c1f9e51706f6f8f6884754623ef0dae3 /util | |
parent | See ChangeLog: Wed May 26 14:36:29 CEST 1999 Werner Koch (diff) | |
download | gnupg-a6a548ab56f931923ddf02c132aa202992445034.tar.gz gnupg-a6a548ab56f931923ddf02c132aa202992445034.zip |
See ChangeLog: Thu May 27 09:40:55 CEST 1999 Werner Koch
Diffstat (limited to 'util')
-rw-r--r-- | util/ChangeLog | 4 | ||||
-rw-r--r-- | util/miscutil.c | 23 |
2 files changed, 27 insertions, 0 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index 0ec6deb40..bf0ebb5f9 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,7 @@ +Thu May 27 09:40:55 CEST 1999 Werner Koch <[email protected]> + + * miscutil.c (answer_is_yes_no_quit): New. + Sun May 23 14:20:22 CEST 1999 Werner Koch <[email protected]> * dotlock.c: Tweaked to make it compile under mingw32 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; +} + + |