mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* keylist.c (reorder_keyblock, do_reorder_keyblock): Reorder attribute
IDs as well as regular text IDs. * plaintext.c (ask_for_detached_datafile): Use make_filename() on filename so tilde expansion works.
This commit is contained in:
parent
4afa18bcaa
commit
8e17d6437d
3 changed files with 24 additions and 4 deletions
|
@ -1379,15 +1379,16 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr )
|
|||
* Reorder the keyblock so that the primary user ID (and not attribute
|
||||
* packet) comes first. Fixme: Replace this by a generic sort
|
||||
* function. */
|
||||
void
|
||||
reorder_keyblock (KBNODE keyblock)
|
||||
static void
|
||||
do_reorder_keyblock (KBNODE keyblock,int attr)
|
||||
{
|
||||
KBNODE primary = NULL, primary0 = NULL, primary2 = NULL;
|
||||
KBNODE last, node;
|
||||
|
||||
for (node=keyblock; node; primary0=node, node = node->next) {
|
||||
if( node->pkt->pkttype == PKT_USER_ID &&
|
||||
!node->pkt->pkt.user_id->attrib_data &&
|
||||
((attr && node->pkt->pkt.user_id->attrib_data) ||
|
||||
(!attr && !node->pkt->pkt.user_id->attrib_data)) &&
|
||||
node->pkt->pkt.user_id->is_primary ) {
|
||||
primary = primary2 = node;
|
||||
for (node=node->next; node; primary2=node, node = node->next ) {
|
||||
|
@ -1418,6 +1419,13 @@ reorder_keyblock (KBNODE keyblock)
|
|||
primary2->next = node;
|
||||
}
|
||||
|
||||
void
|
||||
reorder_keyblock (KBNODE keyblock)
|
||||
{
|
||||
do_reorder_keyblock(keyblock,1);
|
||||
do_reorder_keyblock(keyblock,0);
|
||||
}
|
||||
|
||||
void
|
||||
list_keyblock( KBNODE keyblock, int secret, int fpr, void *opaque )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue