diff options
author | Werner Koch <wk@gnupg.org> | 1999-08-30 20:48:57 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1999-08-30 20:48:57 +0200 |
commit | c2c397bedfe748472a3d1045f24a79a062e7fa5e (patch) | |
tree | 2b0613d28783e42e76908d848167f0244dcbeb88 /util | |
parent | See ChangeLog: Wed Aug 4 10:34:46 CEST 1999 Werner Koch (diff) | |
download | gnupg2-c2c397bedfe748472a3d1045f24a79a062e7fa5e.tar.xz gnupg2-c2c397bedfe748472a3d1045f24a79a062e7fa5e.zip |
See ChangeLog: Mon Aug 30 20:38:33 CEST 1999 Werner Koch
Diffstat (limited to 'util')
-rw-r--r-- | util/ChangeLog | 10 | ||||
-rw-r--r-- | util/dotlock.c | 1 | ||||
-rw-r--r-- | util/miscutil.c | 26 | ||||
-rw-r--r-- | util/secmem.c | 2 |
4 files changed, 38 insertions, 1 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index 0e67818fe..95b06019a 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,13 @@ +Mon Aug 30 20:38:33 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> + + + * secmem.c (pool_okay): declared volatile. + + * miscutil.c (answer_is_yes): Always check for plain "yes". + (answer_is_yes_no_quit): Likewise. + + * dotlock.c (create_dotlock): Fixed segv during cleanup. + Mon Jul 12 14:55:34 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> diff --git a/util/dotlock.c b/util/dotlock.c index 644cf8e3a..369a3d42a 100644 --- a/util/dotlock.c +++ b/util/dotlock.c @@ -123,6 +123,7 @@ create_dotlock( const char *file_to_lock ) S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR ); } while( fd == -1 && errno == EINTR ); if( fd == -1 ) { + all_lockfiles = h->next; log_error( "failed to create temporary file `%s': %s\n", h->tname, strerror(errno)); m_free(h->tname); diff --git a/util/miscutil.c b/util/miscutil.c index b0a6410e8..2b95d97d6 100644 --- a/util/miscutil.c +++ b/util/miscutil.c @@ -253,11 +253,23 @@ answer_is_yes( const char *s ) { char *long_yes = _("yes"); char *short_yes = _("yY"); + char *long_no = _("no"); + char *short_no = _("nN"); if( !stricmp(s, long_yes ) ) return 1; if( strchr( short_yes, *s ) && !s[1] ) return 1; + /* test for no strings to catch ambiguities for the next test */ + if( !stricmp(s, long_no ) ) + return 0; + if( strchr( short_no, *s ) && !s[1] ) + return 0; + /* test for the english version (for those who are used to type yes) */ + if( !stricmp(s, "yes" ) ) + return 1; + if( strchr( "yY", *s ) && !s[1] ) + return 1; return 0; } @@ -269,18 +281,32 @@ int answer_is_yes_no_quit( const char *s ) { char *long_yes = _("yes"); + char *long_no = _("no"); char *long_quit = _("quit"); char *short_yes = _("yY"); + char *short_no = _("nN"); char *short_quit = _("qQ"); if( !stricmp(s, long_yes ) ) return 1; + if( !stricmp(s, long_no ) ) + return 0; if( !stricmp(s, long_quit ) ) return -1; if( strchr( short_yes, *s ) && !s[1] ) return 1; + if( strchr( short_no, *s ) && !s[1] ) + return 0; if( strchr( short_quit, *s ) && !s[1] ) return -1; + if( !stricmp(s, "yes" ) ) + return 1; + if( !stricmp(s, "quit" ) ) + return -1; + if( strchr( "yY", *s ) && !s[1] ) + return 1; + if( strchr( "qQ", *s ) && !s[1] ) + return -1; return 0; } diff --git a/util/secmem.c b/util/secmem.c index 35a265408..8796e6faf 100644 --- a/util/secmem.c +++ b/util/secmem.c @@ -57,7 +57,7 @@ struct memblock_struct { static void *pool; -static int pool_okay; +static volatile int pool_okay; /* may be checked in an atexit function */ static int pool_is_mmapped; static size_t poolsize; /* allocated length */ static size_t poollen; /* used length */ |