mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Finished the bulk of changes for gnupg 1.9. This included switching
to libgcrypt functions, using shared error codes from libgpg-error, replacing the old functions we used to have in ../util by those in ../jnlib and ../common, renaming the malloc functions and a couple of types. Note, that not all changes are listed below becuause they are too similar and done at far too many places. As of today the code builds using the current libgcrypt from CVS but it is very unlikely that it actually works.
This commit is contained in:
parent
b7b07d36e8
commit
c0c2c58054
90 changed files with 5078 additions and 2925 deletions
23
g10/status.c
23
g10/status.c
|
@ -40,6 +40,8 @@
|
|||
#include <sys/mman.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "gpg.h"
|
||||
#include "util.h"
|
||||
#include "status.h"
|
||||
#include "ttyio.h"
|
||||
|
@ -179,9 +181,12 @@ set_status_fd ( int fd )
|
|||
fd, strerror(errno));
|
||||
}
|
||||
last_fd = fd;
|
||||
#warning fixme: register progress CBs
|
||||
#if 0
|
||||
register_primegen_progress ( progress_cb, "primegen" );
|
||||
register_pk_dsa_progress ( progress_cb, "pk_dsa" );
|
||||
register_pk_elg_progress ( progress_cb, "pk_elg" );
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -453,7 +458,7 @@ do_shm_get( const char *keyword, int hidden, int bool )
|
|||
if( bool )
|
||||
return p[0]? "" : NULL;
|
||||
|
||||
string = hidden? m_alloc_secure( n+1 ) : m_alloc( n+1 );
|
||||
string = hidden? xmalloc_secure ( n+1 ) : xmalloc ( n+1 );
|
||||
memcpy(string, p, n );
|
||||
string[n] = 0; /* make sure it is a string */
|
||||
if( hidden ) /* invalidate the memory */
|
||||
|
@ -508,7 +513,7 @@ do_get_from_fd( const char *keyword, int hidden, int bool )
|
|||
if( i >= len-1 ) {
|
||||
char *save = string;
|
||||
len += 100;
|
||||
string = hidden? m_alloc_secure ( len ) : m_alloc ( len );
|
||||
string = hidden? xmalloc_secure ( len ) : xmalloc ( len );
|
||||
if( save )
|
||||
memcpy(string, save, i );
|
||||
else
|
||||
|
@ -579,7 +584,7 @@ cpr_get( const char *keyword, const char *prompt )
|
|||
for(;;) {
|
||||
p = tty_get( prompt );
|
||||
if( *p=='?' && !p[1] && !(keyword && !*keyword)) {
|
||||
m_free(p);
|
||||
xfree (p);
|
||||
display_online_help( keyword );
|
||||
}
|
||||
else
|
||||
|
@ -595,7 +600,7 @@ cpr_get_utf8( const char *keyword, const char *prompt )
|
|||
p = cpr_get( keyword, prompt );
|
||||
if( p ) {
|
||||
char *utf8 = native_to_utf8( p );
|
||||
m_free( p );
|
||||
xfree ( p );
|
||||
p = utf8;
|
||||
}
|
||||
return p;
|
||||
|
@ -615,7 +620,7 @@ cpr_get_hidden( const char *keyword, const char *prompt )
|
|||
for(;;) {
|
||||
p = tty_get_hidden( prompt );
|
||||
if( *p == '?' && !p[1] ) {
|
||||
m_free(p);
|
||||
xfree (p);
|
||||
display_online_help( keyword );
|
||||
}
|
||||
else
|
||||
|
@ -652,13 +657,13 @@ cpr_get_answer_is_yes( const char *keyword, const char *prompt )
|
|||
p = tty_get( prompt );
|
||||
trim_spaces(p); /* it is okay to do this here */
|
||||
if( *p == '?' && !p[1] ) {
|
||||
m_free(p);
|
||||
xfree (p);
|
||||
display_online_help( keyword );
|
||||
}
|
||||
else {
|
||||
tty_kill_prompt();
|
||||
yes = answer_is_yes(p);
|
||||
m_free(p);
|
||||
xfree (p);
|
||||
return yes;
|
||||
}
|
||||
}
|
||||
|
@ -680,13 +685,13 @@ cpr_get_answer_yes_no_quit( const char *keyword, const char *prompt )
|
|||
p = tty_get( prompt );
|
||||
trim_spaces(p); /* it is okay to do this here */
|
||||
if( *p == '?' && !p[1] ) {
|
||||
m_free(p);
|
||||
xfree (p);
|
||||
display_online_help( keyword );
|
||||
}
|
||||
else {
|
||||
tty_kill_prompt();
|
||||
yes = answer_is_yes_no_quit(p);
|
||||
m_free(p);
|
||||
xfree (p);
|
||||
return yes;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue