1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

bug fixes

This commit is contained in:
Werner Koch 2006-10-05 11:06:42 +00:00
parent 23b7b9a77b
commit 158a69aff7
13 changed files with 57 additions and 32 deletions

View file

@ -45,15 +45,17 @@ static FILE *statusfp;
static void
progress_cb ( void *ctx, int c )
progress_cb (void *ctx, const char *what, int printchar,
int current, int total)
{
char buf[50];
char buf[50];
if ( c == '\n' )
sprintf ( buf, "%.20s X 100 100", (char*)ctx );
else
sprintf ( buf, "%.20s %c 0 0", (char*)ctx, c );
write_status_text ( STATUS_PROGRESS, buf );
if ( printchar == '\n' && !strcmp (what, "primegen") )
snprintf (buf, sizeof buf -1, "%.20s X 100 100", what );
else
snprintf (buf, sizeof buf -1, "%.20s %c %d %d",
what, printchar=='\n'?'X':printchar, current, total );
write_status_text (STATUS_PROGRESS, buf);
}
static const char *
@ -209,10 +211,8 @@ set_status_fd ( int fd )
fd, strerror(errno));
}
last_fd = fd;
#warning Use libgrypt calls for progress indicators
/* register_primegen_progress ( progress_cb, "primegen" ); */
/* register_pk_dsa_progress ( progress_cb, "pk_dsa" ); */
/* register_pk_elg_progress ( progress_cb, "pk_elg" ); */
gcry_set_progress_handler ( progress_cb, NULL );
}
int